Like all network operations, performing the POST request may fail for various
reasons. When no response from the remote end is received, a requests.post()
call may never return, leading to an unbounded increase in the sender queue.
To remedy such situations let's add a timeout argument to the requests call and
make it configurable, to be adaptable for different environments.
For more information see
https://2.python-requests.org/en/master/user/quickstart/#timeouts
This reverts commit d41ceabe82. Which I suspect
does not work because the thread is stateful, i.e. after os.fork the thread in
copy of the process thinks it has already been started, even though it is not
alive. Probably safest to just get a new thread instance if a thread is not alive.