cherry-pick 72b9ebf5e16539c13020ac5768d7162ee86f071b