This PR reworks app initialization and main functions to be more resilient to errors.
The server initialization was refactored slightly to remove a magic wait, by moving some initialization to main thread with results injected into the thread before daemonizing.
The client was inadvertently spawning the entire flask application and holding a reference to it through its life cycle. This occasionally was a cause for odd error messages during startup and shutdown because the client was holding sockets and resources that conflicted with the server. This PR removes this initialization completely from the client such that it is totally decoupled, and there is no longer any resource contention.
This closes #87
Checklist
[x] If code changes were made then they have been tested.
[x] This PR fixes an issue.
[ ] This PR adds something new (e.g. new method or parameters).
[x] This PR is a breaking change (e.g. methods or parameters removed/renamed)
server and client main entrypoints had arguments changed. This should only affect the respective main functions which call the entrypoints.
[ ] This PR is not a code change (e.g. documentation, README, ...)
Summary
This PR reworks app initialization and main functions to be more resilient to errors.
The server initialization was refactored slightly to remove a magic wait, by moving some initialization to main thread with results injected into the thread before daemonizing.
The client was inadvertently spawning the entire flask application and holding a reference to it through its life cycle. This occasionally was a cause for odd error messages during startup and shutdown because the client was holding sockets and resources that conflicted with the server. This PR removes this initialization completely from the client such that it is totally decoupled, and there is no longer any resource contention.
This closes #87
Checklist