Bug 49567 - when starting a new thread from a startAsync Runnable, an infinite amount of doPosts is generated
Summary: when starting a new thread from a startAsync Runnable, an infinite amount of ...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Servlet & JSP API (show other bugs)
Version: trunk
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
: 49635 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-07 09:22 UTC by Pieter Libin
Modified: 2010-10-10 17:11 UTC (History)
4 users (show)



Attachments
testcase demonstrating the bug (1.73 KB, text/x-java)
2010-07-07 09:22 UTC, Pieter Libin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pieter Libin 2010-07-07 09:22:22 UTC
Created attachment 25728 [details]
testcase demonstrating the bug

when starting a new thread from a startAsync Runnable, an infinite amount of doPosts is generated.

Also, the GET status is: 500 Internal Server Error,
however, there is no exception thrown by tomcat.

The attached code demonstrates this, by printing "Start async()" an infinite amount of times.
Comment 1 Mark Thomas 2010-07-10 17:26:55 UTC
Looks like you attached the wrong test case to this report.
Comment 2 Pieter Libin 2010-07-12 04:23:47 UTC
(In reply to comment #1)
> Looks like you attached the wrong test case to this report.

Dear Mark,

why do you think this is the wrong test case?
Are you not able to reproduce the problem with it?

Kind regards,

Pieter
Comment 3 Mark Thomas 2010-07-12 04:40:25 UTC
Because at first glance the test case appears to be identical to the previous bug you reported and there is no reference in it to doPost which you refer to in both the title and the description. On closer inspection I see there are differences but I am still confused about the references to doPost in the title and description.
Comment 4 Pieter Libin 2010-07-12 05:26:27 UTC
(In reply to comment #3)
> Because at first glance the test case appears to be identical to the previous
> bug you reported and there is no reference in it to doPost which you refer to
> in both the title and the description. On closer inspection I see there are
> differences but I am still confused about the references to doPost in the title
> and description.

I'm sorry for the confusion, please replace doPost by doGet.
Comment 5 Mark Thomas 2010-07-12 09:58:05 UTC
I've converted the attached test case to a Tomcat 7 unit test and can reproduce the issue. Looking at it now...
Comment 6 Mark Thomas 2010-07-22 02:08:45 UTC
*** Bug 49635 has been marked as a duplicate of this bug. ***
Comment 7 Mark Thomas 2010-07-22 18:51:36 UTC
This has been fixed in 7.0.x and will be included in 7.0.1 onwards.
Comment 8 Kevin 2010-07-31 16:24:10 UTC
(In reply to comment #7)
> This has been fixed in 7.0.x and will be included in 7.0.1 onwards.

Hi, I built from trunk (http://svn.apache.org/repos/asf/tomcat/trunk/) but continue to have this problem. Is the fix in another part of the svn tree?
Thanks.
Comment 9 Mark Thomas 2010-08-01 10:04:29 UTC
Nope. This issue has been fixed in trunk for over a week.
Comment 10 Kevin 2010-08-01 18:36:11 UTC
(In reply to comment #9)
> Nope. This issue has been fixed in trunk for over a week.

Okay, I'm still having the problem with revision 981332:

java.lang.StackOverflowError
        at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:963)
        at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:963)
...

# svn info
Path: .
URL: http://svn.apache.org/repos/asf/tomcat/trunk
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 981332
Node Kind: directory
Schedule: normal
Last Changed Author: markt
Last Changed Rev: 981318
Last Changed Date: 2010-08-01 14:04:25 -0700 (Sun, 01 Aug 2010)

# ant
...
BUILD SUCCESSFUL

# start tomcat from $TRUNK/output/build/bin/startup

I am using the same test as in Bug 49635. Also, how does one write a Tomcat 7 unit test to make bug reporting easier for the Tomcat developers?
Comment 11 Kevin 2010-08-01 19:20:15 UTC
> Okay, I'm still having the problem with revision 981332:

Nevermind, it works, sorry.
Comment 12 Janko 2010-09-20 02:07:11 UTC
Hi, although Kevin backed down, I am still having this problem with the current 7.0.2-beta and with a self-compiled trunk. The identical servlet works perfectly with Glassfish v3.0.1.

java.lang.StackOverflowError
	org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
	org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
	org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
	org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
...

S:\codebase\TOMCAT_trunk>svn info
Path: .
URL: http://svn.apache.org/repos/asf/tomcat/trunk
Repository Root: http://svn.apache.org/repos/asf
Repository UUID: 13f79535-47bb-0310-9956-ffa450edef68
Revision: 998790
Node Kind: directory
Schedule: normal
Last Changed Author: markt
Last Changed Rev: 998554
Last Changed Date: 2010-09-18 23:41:44 +0200 (Sa, 18 Sep 2010)
Comment 13 Kevin 2010-10-10 17:11:27 UTC
(In reply to comment #12)
> Hi, although Kevin backed down, I am still having this problem with the current

Janko, I'm sorry but I'm afraid I can't remember how I resolved the problem, but it ended up being user error. I would suggest checking out a brand new trunk, rebuilding, and starting with the simplest async servlet and seeing if that works.