Issue Details (XML | Word | Printable)

Key: PYFB-41
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Pavel Cisar
Reporter: asmith
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird driver for Python

Failure in event handler not propagated to the main thread

Created: 24/Mar/14 05:28 PM   Updated: 30/Jun/15 07:17 PM
Component/s: None
Affects Version/s: 1.4
Fix Version/s: None


 Description  « Hide
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



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
asmith added a comment - 24/Mar/14 05:31 PM
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.