You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an exception occurs during the __init__ of the stream manager client (for example a bad port is passed or the server is temporarily down) the event loop thread gets leaked. Because the init never returns there is no client object to call close() on.
This can be reproduced with a simple script (assuming the server is not listening on port 1234)
import threading
from greengrasssdk.stream_manager import StreamManagerClient
while True:
threads = threading.enumerate()
print(f"Number of threads: {len(threads)}")
try:
client = StreamManagerClient(port=1234)
except Exception as e:
print(f"Exception: {e}")
which produces the following output:
Number of threads: 1
Connection error while connecting to server: [Errno 111] Connect call failed ('127.0.0.1', 1234)
Exception: [Errno 111] Connect call failed ('127.0.0.1', 1234)
Number of threads: 2
Connection error while connecting to server: [Errno 111] Connect call failed ('127.0.0.1', 1234)
Exception: [Errno 111] Connect call failed ('127.0.0.1', 1234)
Number of threads: 3
Connection error while connecting to server: [Errno 111] Connect call failed ('127.0.0.1', 1234)
Exception: [Errno 111] Connect call failed ('127.0.0.1', 1234)
...
Number of threads: 507
Connection error while connecting to server: [Errno 111] Connect call failed ('127.0.0.1', 1234)
Exception: [Errno 111] Connect call failed ('127.0.0.1', 1234)
Number of threads: 508
Exception: can't start new thread
Number of threads: 508
Exception: can't start new thread
Number of threads: 508
Exception: can't start new thread
This leads to the developer needing to manually find and kill the event loop thread.
The text was updated successfully, but these errors were encountered:
If an exception occurs during the
__init__
of the stream manager client (for example a bad port is passed or the server is temporarily down) the event loop thread gets leaked. Because the init never returns there is no client object to callclose()
on.This can be reproduced with a simple script (assuming the server is not listening on port 1234)
which produces the following output:
This leads to the developer needing to manually find and kill the event loop thread.
The text was updated successfully, but these errors were encountered: