scout_apm_python
scout_apm_python copied to clipboard
Push core agent startup into CoreAgentSocketThread
Currently we download and start the core agent at application startup, blocking its deployment, and carrying the risk that exceptions there will stop the application entirely. We've had some reports of this in the wild too.
#480 has added a little logic around retrying, timeouts, and not dying on the first exception.
We should move the core agent startup, and the gathering of application metadata, into CoreAgentSocketThread, so that we don't block application startup. We still have to be careful not to start any threads until post-fork, which we rely on based on the first real request coming through.