client_python
client_python copied to clipboard
mark_process_dead: avoid error with bad env
When the multiprocess environemnt is not properly set-up (missing environment variable) and mark_process_dead is called, the method raises an error on path.join() because the path is None which may be problematic
This commit simply ignores the cleanup when the variable is not present
Context
We are using the same library for multiprocess and non-multiprocess setups.
While the setup is obviously wrong on our part (adding mark_process_dead using atexit). I thought that check in prometheus_client would be nice addition if anyone would get in the same pitfall