Backport #33147 by changchaishi Fixes #33145 An integration test could be added. --------- Co-authored-by: Chai-Shi <changchaishi@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>