Skip to content

requests: always set a timeout

Antonio Terceiro requested to merge request-timeout into master

Today during a load test I observed that one of my build-sets were waiting forever for 1 build to finish. After I figured out which one, I checked on tuxpub and the build was already finished, but the last state that CLI was aware of was "Building".

Using netstat, I discovered that there was a single connection still established to one of the API IP addresses. strace'ing the process that had it open, I was it was blocked on a read() from the network. I suspect that this might be caused by my router, or even by any box in the network between me and the API, and I have no control over it.

Always setting a timeout on network requests prevents requests that are filtered/blocked at the network level from making tuxsuite build-set block forever on high load situations. Such requests will time out, and be retried, hopefully with different results.

Merge request reports