Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Threading issue with AsyncListener.onTimeout

Jetty version: 9.3.8, Java Version 1.8.0_73

I noticed that the .onTimeout-Method is executed in a Thread called Scheduler-<some number> instead of the qtp-threads other method (onStart/onComplete) are called. Since it seems there are only a small number of Scheduler Threads (in my installation I found that there seem one per connector + one other) if some work blocks in onTimeout the server gets unresponsive at least in respect to other timout events.

Since I have not found much about the jetty Scheduler-Threads (only that there is some kind of Scheduler-Service) I'd liek to ask:
 - What are they used for and how many of them would one expect?
- Can I configure the Number of Threads available, maybe with another Threadpool?
 - Is it desired that onTimeout is executed in this (spare) Threads?
 - If yes why is it not executed in the qtp like other event methods?

I tried to force the work back to the qtp-thread by using:

    event.getAsyncContext().getRequest().setAttribute("Timeout", true);
    event.getAsyncContext().dispatch();

in the onTimeout. But this only calls onComplete on my listener and never reaches my servlet again.

Thanks for any hints :-)



Back to the top