Jersey/Jetty API Handler/Container resends the GET request every 1 min [message #1843128] |
Fri, 16 July 2021 10:39 |
Deepika Malik Messages: 3 Registered: July 2021 |
Junior Member |
|
|
<jersey.version>2.23.2</jersey.version>
<jetty.version>9.4.11.v20180605</jetty.version>
There is a GET API resource registered with Jersey and I am hitting this API from Postman. In case, the num of records is less and can be fetched within 1 minute, API works fine. But, if the request takes more than 1 minute to process, the Jetty Container closes the previous request Socket and sends a new GET request to same API (no external requests are sent, Jetty is sending them itself).
In this way, there is a new API request every 1 min (for 6 mins which is Gateway Timeout) and there are 6 API requests running simultaneously. But, all of them fails with exception An I/O error has occurred while writing a response message entity to the container output stream. because the Socket Connections for all the API requests are already closed after 1 min.
I suspect that it has to do something with the IdleTimeout or ConnectionTimeout on Jersey or Jetty side. But, I am unable to find the exact root cause for it. I tried to search on this topic all over the internet but could not find an answer to the behaviour I am seeing on local.
I also suspect that this might be because of lack of SSL session on local. But, wanted an insight from you on how was this functionality of Jersey, Jetty and SSL designed and implemented.
FYI : There is no SSL Session being used on local. Only Production environment has SSL certificates and sessions. These are non-Async requests.
Q 1. Any idea why Jetty does that ?
Also, I tried to change the timeouts in ServerFactory like so, but nothing changed the above behaviour :
((DefaultServerFactory)startupConfig.getServerFactory()).setIdleThreadTimeout(Duration.minutes(4));
startupConfig.getMetricsFactory().setFrequency(Duration.minutes(4));
Q 2. Any idea what settings need to be changed ?
On Production, SSL Sessions are being used and I don't see this problem there.
Q 3. How would SSL Session change this behaviour of resending the new API requests bu Jetty ?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03699 seconds