New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EventManager thread spikes CPU when FB shuts down [JDBC125] #166
Comments
Modified by: Roman Rokytskyy (rrokytskyy)Fix Version: Jaybird 2.2 [ 10053 ] timeestimate: 0 [ 0 ] timeoriginalestimate: 0 [ 0 ] |
Commented by: @mrotteveel Simple program to reproduce behavior ( file needs to be put in package jdbc125) To reproduce behavior: Problem seems to be in XdrInputstream, the underlying SocketInputstream blocks on read, and this blocks indefinitely since no timeout is set in org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl#openSocket(isc_db_handle_impl, DbAttachInfo, (my attempt to set a timeout there did not solve this though) |
Modified by: @mrotteveelAttachment: JDBC125Reproduction.java [ 11583 ] |
Commented by: Roman Rokytskyy (rrokytskyy) Strange, I just tried the code and it simply fails with error message in stderr: Exception in thread "Thread-1" java.lang.RuntimeException: IOException in event loop: Connection reset Maybe that was something in Java which was fixed in the meantime? |
Commented by: @mrotteveel Retested with Java 1.6.0_26-b03 64-bit server VM on Windows 7 against Firebird 2.5.0. I am also no longer able to reproduce. I scanned the release notes between Java 6 update 18 and Java 6 update 25, but there wasn't anything that really jumped out as to be related to this. Will close this ticket as unable to reproduce. |
Modified by: @mrotteveelassignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ] |
Modified by: @mrotteveelFix Version: Jaybird 2.2 [ 10053 ] => |
Modified by: @mrotteveel |
Submitted by: Philip Williams (unordained)
Jira_subtask_outward JDBC232
Is duplicated by JDBC232
Attachments:
JDBC125Reproduction.java
If I shutdown Firebird 2.1 while I have a connection in Tomcat set to wait for events asynchronously, CPU usage for Tomcat jumps to 100% immediately and stays that way; cannot call eventManager.disconnect() (it fails while trying to unregister events, does not mark itself as disconnected, cannot be re-used for a new connection). I can detect that the connection has dropped by attempting to register more events (from one of my threads) and this will fail right away -- but then I can't do anything about it. Even if I succeed at reconnecting to FB, the next time the server is shut down I'll have two threads both spinning out of control.
Relevant thread dump follows.
"Thread-4" daemon prio=6 tid=0x27200000 nid=0x23cc runnable [0x2751f000..0x2751fb94]
java.lang.Thread.State: RUNNABLE
at org.firebirdsql.gds.impl.wire.XdrInputStream.read(XdrInputStream.java:253)
at org.firebirdsql.gds.impl.wire.XdrInputStream.readInt(XdrInputStream.java:187)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.nextOperation(AbstractJavaGDSImpl.java:2144)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl$EventCoordinatorImp.run(AbstractJavaGDSImpl.java:3116)
at java.lang.Thread.run(Unknown Source)
"Thread-3" daemon prio=6 tid=0x2724f400 nid=0x244c in Object.wait() [0x274df000..0x274dfc14]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x05041e60> (a java.util.ArrayList)
at java.lang.Object.wait(Object.java:485)
at org.firebirdsql.event.FBEventManager$EventDispatcher.run(FBEventManager.java:445)
- locked <0x05041e60> (a java.util.ArrayList)
at java.lang.Thread.run(Unknown Source)
The text was updated successfully, but these errors were encountered: