FirebirdSQL / fdb

Firebird Driver for Python
https://www.firebirdsql.org/en/devel-python-driver/
Other
60 stars 26 forks source link

EventConduit's wait() method never exits on database disconnect #114

Closed mr-rfh closed 1 year ago

mr-rfh commented 1 year ago

Hi. First I want to thank you for your great library.

And now to the problem:

import fdb

con = fdb.connect(database="somedb", user="name", password="pw", charset='UTF8')

with con.event_conduit( ('SYS$EVENT',) ) as conduit:
    print("Start wait")
    events = conduit.wait()
    print(events)

If connection to the firebird have been unexpectedly interrupted I see following exception from the thread in my console.


Exception in thread Thread-1:
...
fdb.fbcore.DatabaseError: ('Error while waiting for events:\n- SQLCODE: 0\n- unknown ISC error 0', 0, 0)

But conduit.wait() neither returns nor throws exceptions, it just hangs infinitely. So the code above doesn't know something went wrong.

pcisar commented 1 year ago

Fix committed.