backport gh-4503 to 1.8