ibpythonic icon indicating copy to clipboard operation
ibpythonic copied to clipboard

Thread hangs indefinitely on exit before disconnect

Open brian-from-quantrocket opened this issue 8 years ago • 0 comments

If you connect to TWS then exit the process before calling conn.disconnect(), the process hangs indefinitely on a thread trying to acquire a lock:

root@f177d5faed17:/# python -c "from ibpythonic import ibConnection; conn = ibConnection(port=4001, clientId=100);conn.connect() and print('connection successful')"
connection successful
^CException ignored in: <module 'threading' from '/opt/conda/lib/python3.6/threading.py'>
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/threading.py", line 1290, in _shutdown
    t.join()
  File "/opt/conda/lib/python3.6/threading.py", line 1056, in join
    self._wait_for_tstate_lock()
  File "/opt/conda/lib/python3.6/threading.py", line 1072, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt

brian-from-quantrocket avatar Jul 22 '17 14:07 brian-from-quantrocket