Skip to content

Set stricter default timeouts for HTTP requests

Matthias Käppler requested to merge mk/http-default-timeout into master

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

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

Merge request reports

Loading