fixes #17514 
P.S.: It would be better to avoid "side effects" of instrumentation process. But it will require more changes and deeply tested.