Maven dependency proxy: shorten workhorse send+upload timeout
🔥 Problem
The maven dependency proxy heavily relies on the following features of workhorse:
-
Gitlab::Workhorse.send_url. -
Gitlab::Workhorse.send_dependency.
Both features will use a similar logic: get a file from a url.
The problem is: that url could be pointing to an address that will never answer. We thus hit a request timeout in those occasions.
That timeout:
- is quite long, 30 seconds from our observations.
- will log and return a
500error.
🚒 Solution
- Add support for an option to use a reduced timeout, like 10 seconds.
- Not sure if there is a better error than the
500. What would be good to describe that the url is an not valid one.400 Bad Request?