[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2018-01-09 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

--- Comment #11 from Mark Thomas  ---
NPE on Tomcat (actually just webapp) stop should be fixed now too.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2018-01-09 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

--- Comment #10 from Mark Thomas  ---
I believe I've fixed the ConcurrentModificationException. Still investigating
the NPE.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2018-01-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

--- Comment #9 from Konstantin Kolinko  ---
(In reply to Konstantin Kolinko from comment #8)
> Testing current Tomcat 8.5-dev @r1820546

That ConcurrentModificationException was when running with Java 7u80.

With Java 8u152 it also occurs. Line numbers are a bit different,
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909)
at java.util.ArrayList$Itr.next(ArrayList.java:859)
at async.Stockticker.run(Stockticker.java:83)
at java.lang.Thread.run(Thread.java:748)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2018-01-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

--- Comment #8 from Konstantin Kolinko  ---
Testing current Tomcat 8.5-dev @r1820546

A ConcurrentModificationException is printed on the console, but not in the
logs.

Nothing interesting in the logs. Not attaching them here.


08-Jan-2018 17:08:49.566 INFO [http-nio-8080-exec-1]
async.AsyncStockServlet. AsyncStockServlet created
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
at java.util.ArrayList$Itr.next(ArrayList.java:831)
at async.Stockticker.run(Stockticker.java:83)
at java.lang.Thread.run(Thread.java:745)
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
at java.util.ArrayList$Itr.next(ArrayList.java:831)
at async.Stockticker.run(Stockticker.java:83)
at java.lang.Thread.run(Thread.java:745)
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)
at java.util.ArrayList$Itr.next(ArrayList.java:831)
at async.Stockticker.run(Stockticker.java:83)
at java.lang.Thread.run(Thread.java:745)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2018-01-08 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

--- Comment #7 from Konstantin Kolinko  ---
Created attachment 35659
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35659&action=edit
catalina.2018-01-08.log.txt

Testing current Tomcat 9.0-dev @r1820558.

Generally - OK.
A NullPointerException when stopping Tomcat,
in AsyncContextImpl.fireOnComplete(AsyncContextImpl.java:116)

I am attaching the log file here.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2018-01-04 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|REOPENED|RESOLVED

--- Comment #6 from Mark Thomas  ---
The ISE was triggered by a bug in the async stock servlet. Multiple threads
were trying to complete the AsyncContext. This has been fixed.

Logging errors in non-container threads at INFO has been dropped to debug. The
application in notified of the error via the standard async error handling so
debug is sufficient here.

The typo in AsyncContextImpl.setErrorState() has been fixed.

Logging failed listener methods at WARN is consistent with listener handling
elsewhere in Tomcat. There are examples of it being logged at ERROR.

I believe all the remaining issues in this report have been resolved.

Fixed in:
- trunk for 9.0.3 onwards
- 8.5.x for 8.5.25 onwards
- 8.0.x for 8.0.49 onwards
- 7.0.x for 7.0.84 onwards

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2017-12-14 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

--- Comment #5 from Konstantin Kolinko  ---
(In reply to Konstantin Kolinko from comment #4)
> > Fixing that appears to have fixed this bug too.
> 
> Confirmed. I cannot reproduce the WARNING message now. Good.

I added some debug/logging code to AsyncStockServlet and can reproduce this
WARNING easily.  This does happen without a SecurityManager.

Two conclusions here:
1. AsyncStockServlet.onError() is:

public void onError(AsyncEvent event) throws IOException {
event.getAsyncContext().complete();
}

This WARNING happens because the complete() call here fails with an
IllegalStateException.

If the call above were wrapped with try/catch, no warning would be printed.


2. There is a typo in AsyncContextImpl.setErrorState()

>listener.fireOnError(errorEvent);
>} catch (Throwable t2) {
>ExceptionUtils.handleThrowable(t);
>log.warn("onError() failed for listener of type [" +
>listener.getClass().getName() + "]", t2);

It should be handleThrowable(t2) instead of (t) above.

Logging a warning here looks excessive.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2017-12-12 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

Konstantin Kolinko  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #4 from Konstantin Kolinko  ---
> Fixing that appears to have fixed this bug too.

Confirmed. I cannot reproduce the WARNING message now. Good.


The first message (INFO) is easy to reproduce:
1. go to http://localhost:8080/examples/async/stockticker
2. press F5, ESC repeatedly

I think it should be controlled via UserDataHelper, or reduced to DEBUG.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2017-12-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Mark Thomas  ---
When I started to investigate this I was getting unexpected 500 responses if I
accessed the example directly. The root cause of that was an
AccessControlException retying to load an anonymous inner class generated by
the compiler when enums are used with switch. Fixing that appears to have fixed
this bug too. With the necessary classes pre-loaded, I can't recreate this.

It is speculation but I suspect what was happening was that the
AccessControlException was causing errors in the error handling and Tomcat's
attempts to clean up after this were causing the ISE.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2017-12-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

--- Comment #2 from Mark Thomas  ---
I can repeat this. I'm looking into why it happens.

The spec is clear about when it is legal to call this method, but unclear as to
what to do if it is called illegally. Generally that means the container can
handle it however it pleases. I'd lean towards an error of some kind because
the API is being used incorrectly.

I'm not sure at this point how long it will take to figure out what is going
on. From experience it will either be a few minutes or a few days.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 61886] 7.0.83 Calling [asyncComplete()] is not valid for a request with Async state [MUST_COMPLETE]

2017-12-11 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=61886

Konstantin Kolinko  changed:

   What|Removed |Added

 OS||All

--- Comment #1 from Konstantin Kolinko  ---
1) The second exception happens in error handling in example

async.AsyncStockServlet.onError(AsyncStockServlet.java:118)

This is implemented as

@Override
public void onError(AsyncEvent event) throws IOException {
event.getAsyncContext().complete();
}



2) Javadoc in AsyncStateMachine

 * MUST_COMPLETE- ServletRequest.startAsync() followed by complete() have
 *been called during a single Servlet.service() method. The
 *complete() will be processed as soon as the request
 *finishes.

It says that both startAsync() and complete() have been called by
Servlet.service() method.

How is it? There is no such code in AsyncStockServlet.


3) Can we ignore duplicate complete() calls?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org