This is a backport-only fix for 1.22 1.23 has a proper fix #32533
Backport #31192 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>