Backport of gh-31873
Backport of gh-31873