Backport of #11262
Backport of #11262