Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006445 [Resin] minor always 10-26-21 07:05 12-16-21 07:35
Reporter amo View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 4.0.65
Summary 0006445: java.lang.IllegalStateException: TcpSocketLink[id=http://...someports...] killKeepalive called from invalid thread
Description We have some web code that looks something like:

   final AsyncContext asyncContext = request.startAsync();
   requestContent(params, callback(asyncConext))

onData() -> writer.writeNext() -> writer.checkError ---> ResponseStream.flush()

at com.caucho.server.http.AbstractHttpRequest.clientDisconnect(
at com.caucho.server.http.AbstractHttpResponse.clientDisconnect(

We believe this now has a wrong/bad state because we think the client disconnected while we were getting the data they wanted so calling:

state.isAsyncStarted() returns false always in this case and throws the exception on:



Additional Information Here's a stack trace:

java.lang.IllegalStateException: killKeepalive called from invalid thread. expected:
at com.caucho.server.http.AbstractHttpRequest.killKeepalive(
at com.caucho.server.http.AbstractHttpRequest.clientDisconnect(
at com.caucho.server.http.AbstractHttpResponse.clientDisconnect(
at com.caucho.server.http.ResponseStream.writeNextBuffer(
at com.caucho.server.http.ResponseStream.flush(
at com.caucho.server.http.ResponseStream.flushChar(
at com.caucho.server.http.ResponseWriter.flush(
at java.base/
at java.base/
...some of our code calling this...
Attached Files

- Relationships

- Notes
11-16-21 13:20

1. how often does this happen?

2. can you send some sample threading details (XXX, YYY, ZZZ) for the exception message below?

    "java.lang.IllegalStateException: XXX killKeepalive called from invalid thread. expected: YYY actual ZZZ"

3. you can log the disconnects by adding FINEST logging to package:
12-16-21 07:35

1. very rare occurrences
2. TcpSocketLink[xx, ACCEPT] killKeepalive called from invalid thread. expected: Thread[resin-port] actual: Thread[lmax service thread]

- Issue History
Date Modified Username Field Change
10-26-21 07:05 amo New Issue
11-16-21 13:20 nam Note Added: 0007005
12-16-21 07:35 amo Note Added: 0007023

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker