backport efeb039 from #11201 fixes #11540 [ci skip]

/cc @senny @pftg