mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-26 07:56:38 +00:00
souphttpsrc: Retry on SERVICE_UNAVAILABLE and INTERNAL_SERVER_ERROR
Those might be temporary issue, for example s3 returns SERVICE_UNAVAILABLE high load, but afterward a few tries the request will work, and it has been observed that internal server error sometimes "fix themselves" so it makes sense to also retry requests, in case. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8128>
This commit is contained in:
parent
99ad918ece
commit
6652360d30
1 changed files with 13 additions and 0 deletions
|
@ -1695,6 +1695,19 @@ gst_soup_http_src_parse_status (SoupMessage * msg, GstSoupHTTPSrc * src)
|
|||
}
|
||||
#endif
|
||||
|
||||
switch (status_code) {
|
||||
case SOUP_STATUS_SERVICE_UNAVAILABLE:
|
||||
case SOUP_STATUS_INTERNAL_SERVER_ERROR:
|
||||
if (src->max_retries == -1 || src->retry_count < src->max_retries) {
|
||||
return GST_FLOW_CUSTOM_ERROR;
|
||||
}
|
||||
/* Error out when max_retries is reached. */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (SOUP_STATUS_IS_CLIENT_ERROR (status_code) ||
|
||||
SOUP_STATUS_IS_REDIRECTION (status_code) ||
|
||||
SOUP_STATUS_IS_SERVER_ERROR (status_code)) {
|
||||
|
|
Loading…
Reference in a new issue