https://stackoverflow.com/questions/55918648
Avoid the race with concurrent threads.
**cherry-pick to 5.x.x, 4.3.x**
(cherry picked from commit 130e1bba31)
https://stackoverflow.com/questions/55918648
Avoid the race with concurrent threads.
**cherry-pick to 5.x.x, 4.3.x**
(cherry picked from commit 130e1bba31)