This is a cherry-pick of a patch in the 1.6.x branch that has not been released yet.
mentioned in commit bb3bc8c7