Closed chibenwa closed 5 years ago
I hit this problem today as well.
May I suggest we keep stop() as is and have an additional function stopAndWait() (or something like that) for those who don't want the stopping calls to be done in a separate thread.
See PR #730 .
:+1: for addressing this. Ran into this problem with automatic integration tests where I have to start and stop regularly. My current workaround using a wait() is not very satisfying.
Isn't that fixed with awaitStop() in 2.8.0? I think, that issue should be closed
Yes that is adresses.
Hi everyone.
One of my collegues recently wrote a test about default exception handling, involving registration of exception handler. Curiously, test order impacted test correctness (breaking test isolation) leading to a funny debug session.
It turned out the
Service::stop
is run in an other thread. Thus our test suite was starting a new test before thestop
operation finished. A data race between the new test and the old test resulted in the handler of the new test being deleted by the old test....Needless to say, I need to achieve strong test isolation. My proposal is simple: return Future that the user can await on to ensure cleaning process finished.
I will have a pull request for this.