Backport #11033 to 4-0-0

Backport pull request #11033 to 4-0-0

/cc @fxn