RED-36660 Improved thread safety