javaee / grizzly

Writing scalable server applications in the Java™ programming language has always been difficult. Before the advent of the Java New I/O API (NIO), thread management issues made it impossible for a server to scale to thousands of users. The Grizzly NIO framework has been designed to help developers to take advantage of the Java™ NIO API.
https://javaee.github.io/grizzly/
Other
222 stars 60 forks source link

Deadlock with SelectorRunner in Grizzly 2.4.2 #1983

Closed andrelanka closed 6 years ago

andrelanka commented 6 years ago

Now and then (after a few weeks of uptime) our Grizzyl-based web server stops working properly. 100% CPU consumption but no requests are executed. The thread dump contains the following message:

Found one Java-level deadlock:

"Thread-245961": waiting to lock monitor 0x00007f99a00778a8 (object 0x00000000c807f460, a java.util.Collections$SynchronizedList), which is held by "grizzly-nio-kernel(2) SelectorRunner"

"grizzly-nio-kernel(2) SelectorRunner": waiting to lock monitor 0x00007f99901fbd58 (object 0x00000000c807b3a8, a org.glassfish.grizzly.http.server.Response$SuspendedContextImpl), which is held by "Thread-245961"

Java stack information for the threads listed above:

"Thread-245961": at java.util.Collections$SynchronizedCollection.remove(Collections.java:2038)

"grizzly-nio-kernel(2) SelectorRunner": at org.glassfish.grizzly.http.server.Response$SuspendedContextImpl.markCancelled(Response.java:2060)

Found 1 deadlock.

Any ideas? Further information needed? Any help is highly appreciated.

Thanks in advance André