Skip to content

Thread hangs indefinitely on exit before disconnect #1

@brian-from-quantrocket

Description

@brian-from-quantrocket

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions