-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use websockets for json communication (#4490)
* first commit * Fix bugs * Fix more bugsz * slight change * minor bug fixes * It's working quite well now * Update to solve that last bug. I think it should work now * bug fix that was causing messages to be send to tall worker threads * Fix unittests issue and fix formatting * Minor change to increase robustness of message sending * Some more formatting changes * Add in worker auth and use wss rather than ws for websocket URLs to make it secure. Not yet tested b/c on plane and internet isn't good enough to run CodaLab (and download images and such) * Added in server auth with secret. Aslo still need to test (still on plane) * Fixed issues and got auth working. Now, I'll work on returning error codes so that we have proper tests * Add in tests for authentication functionality (for worker and server) * Slight cleanup to data sending code * Adding in ssl certification * Add in SSL stuff for worker; still testing on dev * Revert "Add in SSL stuff for worker; still testing on dev" This reverts commit 4eb3d7b. * Revert "Adding in ssl certification" This reverts commit cbd1505. * Fixed formatting * Very minor formatting change to ignore one line for MyPy * Another minor formatting change * add exponential backoff to see if that fixes dev issue * Added code to actually detect worker disconnections now so that some websockets will be invalidated * Make sockets get looped over in random order to help distribute load * Clean up ws-server and delete a Dataclass I was using previously * a few more minor changes * Make websocket locks more robust and improve error messaging * More permissible retries in case of other errors (e.g. like 1013). With exponential backoff, it's still not very aggressive at all * minor change to have a different error message if worker doesn't yet have any sockets open with ws-server * Rename send_json and send_json_message_with_sock * Rearrange worker_model to minimize diff * Final changes * Fix formatting * Minor changes to get auth working again and to robustly return an error if the client tries to connect to an invalid path. * Merge in master and make some minor changes --------- Co-authored-by: AndrewJGaut <[email protected]>
- Loading branch information
1 parent
528db0f
commit 7c460c1
Showing
14 changed files
with
349 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.