Closed arinban closed 7 years ago
@rlubke Commented Please provide a test case demonstrating the issue.
@rlubke Commented Closing this out as there has been no further response.
@jGauravGupta Commented Hi @rlubke ,
Sorry for the delay, Please find the attached project with unit test case to reproduce the issue. In this unit test, If TransactionTimeout is enabled then service method is called 2 or 3 times after timeout so SQL query is also executed more than once. GrizzlyTxTimeoutTest.zip
Note : Query is using mysql SLEEP function for delay so mysql db connection is also required. H2 mysql mode is not working with SLEEP function.
@jGauravGupta Commented Hi @rlubke ,
I tried the latest version 2.4.1 and 3.0-SNAPSHOT but I can still reproduce it. Is this issue fixed ? Thanks for looking into this !
@rlubke Commented When running your test case, I see your log statement printed twice:
Executing query
Looking at the wire trace, I see the request executed twice on the wire. I don't believe there's an issue with Grizzy here. The client is retrying.
@jGauravGupta Commented Here are the wire trace :
First Call :
at org.glassfish.grizzly.http.server.TransactionTimeoutTest$1.service(TransactionTimeoutTest.java:39) at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:229) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:594) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:574) at java.lang.Thread.run(Thread.java:748)
Repeated Call :
at org.glassfish.grizzly.http.server.TransactionTimeoutTest$1.service(TransactionTimeoutTest.java:39) at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:229) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:594) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:574) at java.lang.Thread.run(Thread.java:748)
Unfortunately H2 (MYSQL mode) does not support SLEEP function so you need a active MYSQL connection to reproduce it.
Description
Servlet request is executed twice (or n time) if timeout occurs while waiting for jdbc call
Expected Outcome
If a request takes too long to respond & timeout is reached then it shouldn't try to run the request second time.
Current Outcome
If 60 seconds request timeout is configured & the request has to run for 100 seconds, for example, the following happens:
If the jdbc call is replaced with sleep the second request is not dispatched, as expected.