cherry-pick 0c404b528f2c5036782eb5ac36882b0df5620947