Backport #30284 by @silverwind Co-authored-by: silverwind <me@silverwind.io> (cherry picked from commit d09ddb52501a0342cc07df8ae312b847ebd98d96)