tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Tomcat appears to be sending duplicate requests
Date Fri, 08 Jul 2011 13:53:04 GMT
peterjca wrote:
> It's running now on Tomcat 7. I've had duplicate requests so checked the
> access logs. All requests have 200 response code.
> 
> :confused:

Hi.
I am not going to provide the solution, just intervening on the "form" aspect of the dialog.
You have obviously put a lot of effort in checking out what happens, and in phrasing your

original question. Bonus points for that.

This being said,
- Tomcat is not "sending duplicate requests to the webapp".  Tomcat receives requests, and

for each request it "runs" the corresponding webapp. The "sending requests" bit is a bit 
confusing, and since the rest of your communication is quite precise, it would be better 
to continue in that spirit.
- Seen in the absolute, it is not impossible that there is a bug in Tomcat.  But it is 
relatively unlikely that Tomcat would receive one HTTP request, and then run the 
corresponding webapp twice with the same request.
It is even more unlikely that two different versions of Tomcat would be doing that
(because with the thousands of Tomcats in use, someone would have noticed this earlier).
This is why the people answering so far obviously tend to look for some other explanation

to what you think you are seeing.  They may be wrong, but "extraordinary claims need to be

backed by extraordinary evidence".
- What Konstantin was saying about authentication, and which maybe you overlooked, was 
that when authentication is involved, the normal cycle of events is :
   - the client sends a first HTTP request, without authentication
   - the server sends back a response saying "this needs authentication"
   - the client then sends *the same request* again, this time with some form of
     authentication
   - this time, the server accepts the request
So, depending on how your client (your test application) exactly works, and the type of 
authentication used, and on where exactly you are keeping track of the requests and 
executed webapps, you may (or may not) be miscounting the actual number of HTTP 
requests/responses.
Since we do not have access to your code and cannot inspect it in the same detail as 
yourself, we are asking you for some precise details, and hoping that you are not 
providing answers without actually checking them carefully.
You may for instance want to disable the authentication part (if possible), and redo your

tests, to make sure that the discrepancy does not originate there.
- In your test client application, to send the requests, you are using several layers of 
existing Java or other HTTP-related and TCP-related code.  One of these layers, under 
particular circumstances, may be repeating some requests, without your application even 
knowing about it.  Granted, this is unlikely, but it is no more unlikely than Tomcat 
executing the same request twice.
That is why Pid was recommending that you use some form of protocol analyser (which is 
independent from both your test app and from Tomcat), to make sure that, really, the 
requests are only being sent one time over the connection.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message