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
fbclient executes callback function twice on two different threads [CORE4795] #5093
Comments
Commented by: @mrotteveel If I add the eventId and length argument of the callback: Queue invoked from Thread: Thread[Thread-2,5,main] |
Commented by: @mrotteveel Ignore my comment I previously posted here. I am still investigating the exact cause of the access violation. |
Modified by: @AlexPeshkoffassignee: Alexander Peshkov [ alexpeshkoff ] |
Commented by: @AlexPeshkoff Mark I've reproduced extra callback when event is posted. Please try now. In C++ test I can't reproduce extra callbacks wheb canceling event. |
Commented by: @mrotteveel In tests with Firebird-3.0.0.31855-0_x64 the spurious callbacks no longer occur. For Jaybird 2.2 the spurious callback was a real problem. The callback with length 0 was taken as a signal of event cancellation and to handle the cleanup of the event blocks. |
Commented by: @AlexPeshkoff Mark can I resolve this issue? |
Commented by: @mrotteveel Yes, this problem no longer occurs. |
Modified by: @AlexPeshkoffstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Beta 2 [ 10586 ] |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: @mrotteveel
The firebird 3.0.0.31839 fbclient invokes the callback function twice for each triggered event and for cancellation. For example the Jaybird TestFBEventManager.testWaitForEventWithOccurrence() shows the following (when code is added to show the thread identity):
Queue invoked from Thread: Thread[Thread-2,5,main]
Callback invoked from Thread: Thread[Thread-3,5,main]
Queue invoked from Thread: Thread[Thread-3,5,main]
Callback invoked from Thread: Thread[Thread-4,5,main]
Callback invoked from Thread: Thread[Thread-5,5,main]
Queue invoked from Thread: Thread[Thread-5,5,main]
Cancel invoked from Thread: Thread[Thread-2,5,main]
Callback invoked from Thread: Thread[Thread-6,5,main]
Callback invoked from Thread: Thread[Thread-2,5,main]
As you can see the initial queue gets one callback (as expected), but the second queue receives two callbacks, and the cancel also receives two callbacks.
The same code with the 2.5.4 fbclient shows:
Queue invoked from Thread: Thread[Thread-2,5,main]
Callback invoked from Thread: Thread[Thread-3,5,main]
Queue invoked from Thread: Thread[Thread-3,5,main]
Callback invoked from Thread: Thread[Thread-4,5,main]
Queue invoked from Thread: Thread[Thread-4,5,main]
Cancel invoked from Thread: Thread[Thread-2,5,main]
Callback invoked from Thread: Thread[Thread-2,5,main]
Commits: 9bf96dd FirebirdSQL/fbt-repository@4abff04
The text was updated successfully, but these errors were encountered: