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
Merge pull request #952 from cderici/optimize-teardown
#952
#### Description
This solves a couple of issues about the connection teardown. The main observation is that we have a rogue connection that we open to the controller during model connection to get some model info but never close. That connection has its own pinger/receiver tasks and an internal websocket object (and that object has its own managing tasks etc), and because this connection is totally forgotten, these tasks etc are not handled properly. For a long time I thought the task errors we were intermittently receiving were about the tasks belonging to the main connection. This fixes it by just using the `ConnectedController` context manager to properly disconnect after used, which wraps up the tasks gracefully.
Another change is that this reduces the websocket close timeout to 1 second (default is 10). With the first change, we essentially won't need this, but in any case, we might wanna experiment with this timeout to make sure we don't get false closes.
#### QA Steps
I used @jameinel 's annotate script to reproduce the issues and investigate this, so I think it would make a good use for QAing this as well:
https://github.com/jameinel/test-annotate/blob/main/annotate.py
0 commit comments