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
Cpu spike to 100% after stopping firebird when using FBEventManager [JDBC232] #281
Comments
Commented by: Tomasz Kujalow (tkujalow) My reproduction test |
Modified by: Tomasz Kujalow (tkujalow)Attachment: JDBC232Reproduction.java [ 12097 ] |
Commented by: Tomasz Kujalow (tkujalow) I made new tests for new version 2.2 (2011-11-20) builded from cvs. In my aplication I resolve this problem by : This solved my problem with 100%cpu spike (but only for Jaybird 2.2) after stopping Firebird, but this is complicated and take a lot of time for testing this scenario. |
Modified by: @mrotteveel |
Commented by: @mrotteveel Seems to be same issue as JDBC125 which I closed as I could no longer reproduce it. I will look at it again |
Modified by: @mrotteveelassignee: Roman Rokytskyy [ rrokytskyy ] => Mark Rotteveel [ avalanche1979 ] |
Commented by: @mrotteveel XdrInputStream does not correctly handle end of stream conditions for a single read(), and continously reads the same buffer positon (0). As a result the eventloop in EventCoordinatorImpl loops continously (which could be viewed as a busy-waiting loop) |
Commented by: @mrotteveel For Jaybird 2.2 (after beta-1). |
Modified by: @mrotteveelstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: Jaybird 2.2 [ 10053 ] |
Modified by: @mrotteveelVersion: Jaybird 2.1.6 [ 10285 ] |
Modified by: @mrotteveelstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Tomasz Kujalow (tkujalow)
Jira_subtask_inward JDBC125
Duplicates JDBC125
Attachments:
JDBC232Reproduction.java
Hello.
I also have problem with FBEventManager. This component and catching events work fine. Problem begin when server stop. CPU consumption spike to 100% (100% of one core, 50% whole my computer cpu). And never ends even after starting Firebird. I prepared reproduction test, which show it.
My output:
Database: t:\test.gdb
User: sysdba
Password: masterkey
java.version: 1.6.0_30
java.vm.version: 20.5-b03
java.vm.vendor: Sun Microsystems Inc.
http://java.vm.name: Java HotSpot(TM) Client VM
java.compiler: null
java.vendor: Sun Microsystems Inc.
os.arch: x86
http://os.name: Windows XP
os.version: 5.1
+-------------------------------------------
| Threads:
| [system] Reference Handler 2 P(10) A(true) I(false) D(true) <null> 0
| [system] Finalizer 3 P(8) A(true) I(false) D(true) <null> 0
| [system] Signal Dispatcher 4 P(9) A(true) I(false) D(true) sun.misc.Launcher$AppClassLoader@9cab16 0
| [system] Attach Listener 5 P(5) A(true) I(false) D(true) sun.misc.Launcher$AppClassLoader@9cab16 0
| [main] main 1 P(5) A(true) I(false) D(false) sun.misc.Launcher$AppClassLoader@9cab16 171875000
| [main] Thread-0 8 P(5) A(true) I(false) D(true) sun.misc.Launcher$AppClassLoader@9cab16 0
| [main] Thread-1 9 P(5) A(true) I(false) D(true) sun.misc.Launcher$AppClassLoader@9cab16 0
| current Thread: [main] main 1 P(5) A(true) I(false) D(false) sun.misc.Launcher$AppClassLoader@9cab16 171875000
+-------------------------------------------
-----------------------------------------
Stop now the Firebird server to see CPU spike (for thread id=9)
-1.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] ->
0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] -> 0.0[%] ->
32.327587[%] -> 98.4375[%] -> 98.41328[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] -> 98.52217[%] -> 100.0[%] -> 98.4375[%] -> 100.0[%] ->
100.0[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] ->
100.0[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] -> 100.0[%] -> 99.96309[%] -> 99.96309[%] -> 100.0[%] -> 96.98276[%] -> 98.4375[%] ->
99.96309[%] -> 96.875[%] -> 100.0[%] ->
When I show trace for thread which produces 100% cpu:
trace= main {java.lang.Thread}org.firebirdsql.gds.impl.wire.XdrInputStream.readInt(XdrInputStream.java:187)
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.nextOperation(AbstractJavaGDSImpl.java:2144)
org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl$EventCoordinatorImp.run(AbstractJavaGDSImpl.java:3116)
java.lang.Thread.run(Unknown Source)
I made many tests and I'm sure this bug.
Commits: 360187d
The text was updated successfully, but these errors were encountered: