Revert "Merge pull request #19736 from pivanov/bug-1017027"

This reverts commit eced604040a970e65dfb51fa83e1a18a9d00b7db, reversing
changes made to 93402e84de5a9ae3824aead5fb03ce9be984f09e.