If the software doesn't launch correctly (such that the Rov::init method is not called), the program will enter deadlock and hang indefinitely. This is caused by the shutdown hook method Rov::shutdown waiting for the dead flag to be set
void shutdown() {
Logger.info("Shutting down");
killSwitch.onCompleted();
while (true) {
if (dead.get()) {
break;
}
...
If init fails to complete, there is no guarantee that the observable which listens to killswitch will be called. ie) the call takeUntil(killSwitch). Possible Solutions: We need to make sure that this subscription has been established in our spinlock, add a timeout, or be more clever in how we set the dead variable. (or a mixture of a these ideas)
If the software doesn't launch correctly (such that the
Rov::init
method is not called), the program will enter deadlock and hang indefinitely. This is caused by the shutdown hook methodRov::shutdown
waiting for thedead
flag to be setIf
init
fails to complete, there is no guarantee that the observable which listens tokillswitch
will be called. ie) the calltakeUntil(killSwitch)
. Possible Solutions: We need to make sure that this subscription has been established in our spinlock, add a timeout, or be more clever in how we set thedead
variable. (or a mixture of a these ideas)