Re: Receiving duplicate requests when code that processes the initial request blocks for a long time ...

2008-08-21 Thread Mashama McFarlane
I don't think any of the subsequent requests are intended functionality of
Tomcat.  Having a single request be serviced more than once does not make
sense to me.  I don't think it is a browser issue.  I have replicated it
with both Firefox and IE.  I have replicated it with standard browser POSTs
and Flash/Flex AMF remoting calls.  My applications services many different
requests and I have never seen this behavior before.  This is the first time
that during the servicing of a request my code blocks for such a substantial
amount of time.  I am using Lighttpd in front of Tomcat so I guess that
answers the proxy/loadbalancer question.  I will look into using tcpdump to
make sure subsequent requests are not arriving through the network.  Thanks
for your assistence.

m.

On Thu, Aug 21, 2008 at 1:38 AM, Juha Laiho [EMAIL PROTECTED] wrote:

 Mashama McFarlane wrote:
  I am not sure if this is a bug, feature, or whatever but I definitely
 need
  some answers here.  I ran into some issues when sending a request to a
  servlet that executes native code that takes a long time to terminate (I
 am
  talking 10s of seconds here).  I am consistently getting a second,
 sometimes
  a third, duplicate request about 6-8 seconds into the execution of the
  initial request.

 Are you certain this second request is functionality of Tomcat?

 Could it be your browser, or perhaps a proxy/loadbalancer between
 your browser and Tomcat?

 You mentioned that the Tomcat server is running a version of Linux, so if
 you
 have root access on the server you're running Tomcat, you should be able to
 run tcpdump (or some other network traffic monitor) to see what actually is
 coming in from the network.
 --
 ..Juha

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
If opportunity doesn't knock, build a door. - Milton Berle

First they ignore you, then they laugh at you, then they fight you, then
you win. - Mohandas Gandhi

Live as if you were to die tomorrow. Learn as if you were to live forever.
- Mohandas Gandhi


Receiving duplicate requests when code that processes the initial request blocks for a long time ...

2008-08-20 Thread Mashama McFarlane
Hi,

I am not sure if this is a bug, feature, or whatever but I definitely need
some answers here.  I ran into some issues when sending a request to a
servlet that executes native code that takes a long time to terminate (I am
talking 10s of seconds here).  I am consistently getting a second, sometimes
a third, duplicate request about 6-8 seconds into the execution of the
initial request.  After alittle investigation I realized I could replicate
this issue by replacing the code that executes the native code with an
infinitely blocking loop ... while(true).  As I said before sometimes I even
get a second duplicate request which has me thinking that this is
unexpected/unintended behavior.  Here is a small snippet of code that should
allow you to replicate the issue:

public void doPost(HttpServletRequest request, HttpServletResponse response)
{
  System.out.println(request);
  while(true);
}

In the interest of full disclosure I have a lot more code than what you see
in the provided snippet and I have not tested the aforementioned code
snippet.  I have replicated the issue on a dedicated server and a local VM,
both running CentOS 4.5, Java SE 1.6.0, and Tomcat 6.  If this is a feature
is there a way to turn it off?  If this is a bug is there a workaround?

Regards,
Mashama

-- 
If opportunity doesn't knock, build a door. - Milton Berle

First they ignore you, then they laugh at you, then they fight you, then
you win. - Mohandas Gandhi

Live as if you were to die tomorrow. Learn as if you were to live forever.
- Mohandas Gandhi


Re: Receiving duplicate requests when code that processes the initial request blocks for a long time ...

2008-08-20 Thread Juha Laiho
Mashama McFarlane wrote:
 I am not sure if this is a bug, feature, or whatever but I definitely need
 some answers here.  I ran into some issues when sending a request to a
 servlet that executes native code that takes a long time to terminate (I am
 talking 10s of seconds here).  I am consistently getting a second, sometimes
 a third, duplicate request about 6-8 seconds into the execution of the
 initial request.

Are you certain this second request is functionality of Tomcat?

Could it be your browser, or perhaps a proxy/loadbalancer between
your browser and Tomcat?

You mentioned that the Tomcat server is running a version of Linux, so if you
have root access on the server you're running Tomcat, you should be able to
run tcpdump (or some other network traffic monitor) to see what actually is
coming in from the network.
-- 
..Juha

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]