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
Describe the bug
Currently workers are started in the server's constructor, rather than in the server's run method. This means the simple act of constructing the server instance will start all worker threads, which will then persist until the server is started/run and then stopped.
I feel like the correct way to handle this is to only start the workers in run().
To Reproduce
Steps to reproduce the behavior: new WebSocketServer(); anywhere will start the worker threads, which persist.
Example application to reproduce the issue
For example, this trivial application will never exit because the threads keep it alive:
Describe the bug
Currently workers are started in the server's constructor, rather than in the server's run method. This means the simple act of constructing the server instance will start all worker threads, which will then persist until the server is started/run and then stopped.
I feel like the correct way to handle this is to only start the workers in run().
To Reproduce
Steps to reproduce the behavior:
new WebSocketServer();
anywhere will start the worker threads, which persist.Example application to reproduce the issue
For example, this trivial application will never exit because the threads keep it alive:
https://gist.github.com/BobVul/707d04de68ad0a603791b1a05ca3e809
Expected behavior
The threads should not be started until start() or run() are called.
Debug log
The the debug log ('WebSocketImpl.DEBUG = true') to help explain your problem.
Environment(please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: