quarkiverse / quarkus-ironjacamar

IronJacamar is an implementation of the Jakarta Connector Architecture specification
https://docs.quarkiverse.io/quarkus-ironjacamar/dev/index.html
Apache License 2.0
4 stars 2 forks source link

Risk of thread blocked alert when waiting too long inside ResourceAdapterLifecycleListener hooks #108

Closed vondacho closed 6 months ago

vondacho commented 6 months ago

The ResourceAdapterLifecycleListener interface has been recently developed in order to satisfy the need to perform some operations before or after is launched or shutdown, for example, pausing the early JMS message consumption at application startup.

The current issue aims to raise the high risk of thread blocked warning by Vert.x if pausing too long at pre-startup or another hook, Vert.x usually raises an exception mentioning a maximal timeout threshold of 60000ms.

Similar to the Scheduler API, it would be welcome to be able to pause and resume an already started ResourceAdpaterinstance.

Regards

gastaldi commented 6 months ago

I need to investigate this, but my gut feeling says that it may depend if the ResourceAdapter implementation (Artemis in your case) supports such feature, as pausing is not defined in the JCA spec.

As a workaround, you can increase the warning exception time:

quarkus.vertx.max-worker-execute-time=5M
gastaldi commented 6 months ago

As a workaround, you can increase the warning exception time:

quarkus.vertx.max-worker-execute-time=5M

Actually that information is not being used when deploying the Verticle, I'll submit a PR soon

gastaldi commented 6 months ago

Since we can't pause the adapter, I'll take that https://github.com/quarkiverse/quarkus-ironjacamar/commit/4f39701f7088f45155dfe7413a35bd7a397c4298 fixed the problem and close this issue. Feel free to reopen if that's not enough