Backport #27269 by @wxiaoguang Fix #27223 Regression of #27122 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>