Set stricter default timeouts for HTTP requests
What does this MR do?
We currently do not set any HTTP client timeouts for opening, reading from or writing to network sockets via Gitlab:HTTP
(itself a wrapper for HTTParty
, itself a wrapper for Net::HTTP
). This means we're using whatever Ruby's default is for Net::HTTP
, which turns out to be 60 seconds -- a very long time to potentially block on an unreachable resource.
This MR sets defaults for:
- open: 10 seconds
- read: 20 seconds
- write: 30 seconds
See also !37924 (merged)
I put this behind a feature flag called http_default_timeouts
.
Feature flag issue: #233109 (closed)
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry Change is behind a feature flag -- if approved I will create follow-up issues.
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
Since this is just configuration happening during class loading, I did not add any tests.
I tested it manually though, similar to what I described here: !37924 (merged)
Edited by Matthias Käppler