Backport #26430 by @lunny Fix #26165 Fix #25257 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> (cherry picked from commit 23139aa27b)
23139aa27b