Backport 4116 patch into release_2.4 branch