Forward port of issue #21610 to 2.4.0-M1.