Fix hot restart race condition (#644)

* Fix hot restart race condition
4 files changed