Skip to content
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

Failure in event handler not propagated to the main thread [PYFB41] #60

Closed
firebird-automations opened this issue Mar 24, 2014 · 3 comments

Comments

@firebird-automations
Copy link

Submitted by: asmith (asmith)

Any exception in the event_process method causes the event thread started by fdb to die, but this error is in no way propagated, so process continues to run, but events are no longer consumed.

@40000000531fed1d03a23aac waiting for events
@40000000531fee592f1640ac Exception in thread Thread-1:
@40000000531fee592f16487c Traceback (most recent call last):
@40000000531fee592f164c64 File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
@40000000531fee592f16504c self.run()
@40000000531fee592f165434 File "/usr/lib/python2.6/threading.py", line 484, in run
@40000000531fee592f16581c self.__target(*self.__args, **self.__kwargs)
@40000000531fee592f165c04 File "/usr/lib/python2.6/site-packages/fdb/fbcore.py", line 1775, in event_process
@40000000531fee592f97e814 events = data.count_and_reregister()
@40000000531fee592f97ebfc File "/usr/lib/python2.6/site-packages/fdb/fbcore.py", line 1734, in count_and_reregister
@40000000531fee592f97efe4 self.__wait_for_events()
@40000000531fee592f97f3cc File "/usr/lib/python2.6/site-packages/fdb/fbcore.py", line 1720, in __wait_for_events
@40000000531fee592f97f7b4 "Error while waiting for events:")
@40000000531fee592f980f24 DatabaseError: ('Error while waiting for events:\n- SQLCODE: -902\n- Error reading data from t
he connection.', -902, 335544726)
@40000000531fee592f98130c

@firebird-automations
Copy link
Author

Commented by: asmith (asmith)

For our purposes it was enough to just log the error and propagate a KeyboardException via thread.interrupt_main()

For the library interface it would probably be useful to know what happened in sys.exc_info but that would require some shared variable or callback from the main thread to be available.

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants