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:

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

callback(){
onData() -> writer.writeNext() -> writer.checkError ---> ResponseStream.flush()
}

meanwhile:
at com.caucho.server.http.AbstractHttpRequest.clientDisconnect(AbstractHttpRequest.java:459)
at com.caucho.server.http.AbstractHttpResponse.clientDisconnect(AbstractHttpResponse.java:211)

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: TcpSocketLink.java:1612)

Thanks

Amo


Additional Information Here's a stack trace:

java.lang.IllegalStateException: killKeepalive called from invalid thread. expected:
at com.caucho.network.listen.TcpSocketLink.killKeepalive(TcpSocketLink.java:1612)
at com.caucho.server.http.AbstractHttpRequest.killKeepalive(AbstractHttpRequest.java:1773)
at com.caucho.server.http.AbstractHttpRequest.clientDisconnect(AbstractHttpRequest.java:459)
at com.caucho.server.http.AbstractHttpResponse.clientDisconnect(AbstractHttpResponse.java:211)
at com.caucho.server.http.ResponseStream.writeNextBuffer(ResponseStream.java:900)
at com.caucho.server.http.ResponseStream.flush(ResponseStream.java:589)
at com.caucho.server.http.ResponseStream.flushChar(ResponseStream.java:614)
at com.caucho.server.http.ResponseWriter.flush(ResponseWriter.java:176)
at java.base/java.io.PrintWriter.flush(PrintWriter.java:396)
at java.base/java.io.PrintWriter.checkError(PrintWriter.java:433)
...some of our code calling this...
Attached Files

- Relationships

- Notes
(0007005)
nam
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:

    com.caucho.network.listen
 
(0007023)
amo
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