So, the situation is like this: vert.x backend app has a worker Verticle instance that invokes a static method from Service class that in turn invoke a method from a 3rd Java lib that makes some requests and returns the result.
The problem arises in a specific situation where the 3rd party lib call hangs. The app gets stuck indefinitely at
java.base@11.0.8/java.net.SocketInputStream.socketRead0(Native Method)
and the vert.x BlockedThreadChecker
starts throwing out warnings:
WARNING: Thread Thread[vert.x-worker-thread-18,5,main]=Thread[vert.x-worker-thread-18,5,main] has been blocked for 61537 ms, time limit is 60000 ms
and the verticle is left unresponsive.
I was looking for a solution of this issue. Changing the whole 3rd party lib would probably be an option if there was an alternative or time. Worker verticle (which I'm already using) and executeBlocking
are not the solution because this is an infinitely blocking operation. I tried recognizing the hang with the separate watchdog verticle and redeploying it; this helped in a way that verticle was useful again but thread checker was still giving out warnings about the Thread blocked.
The best solution I have come so far is to let a watchdog recognize a hang and do a restart of the whole app, but that seems a bit radical and I would prefer to do it without shutting the app down, if possible. Is there an option I have overlooked?
Thank you in advance for advice.