Page 1 of 1

HTTP Get Request 5xx response

Posted: Thu Oct 12, 2023 1:49 am
by jasonx
Hey everyone,

I download PDF files from our CDN. Our provider had issues yesterday where there service wasn't operating correctly. I was receiving many 503 responses and this seemed to crash the HTTP request and not retry or timeout the job. To get around it I set a hold condition to allow one job at a time. What would happen is this job then would become stuck and not allow any othher jobs to process until I manually deleted the job. Is there a way of handling the 503 response more cleanly using another method of downloading PDF files over HTTP? I understand the server should be giving correct responses but we don't fully control this external service.

It also seems then the job uses one of the cocurrent job slots and doesn't free up until its removed.

Thanks

Re: HTTP Get Request 5xx response

Posted: Thu Oct 12, 2023 8:43 am
by freddyp
When the HTTP request element receives a 5xx HTTP error it does not crash, but it goes into fail mode. You can see that because there is a red wheel on the element. In the Switch Preferences in the Error handling section there is a setting "Retry failed external processes". That is a value in minutes and if not 0 Switch will retry the jobs that are waiting in the input folder every x minutes. So, once the web service is restored the flow will continue processing the jobs.

Re: HTTP Get Request 5xx response

Posted: Fri Oct 13, 2023 7:13 am
by jasonx
Thanks Freddy,

It seemed like the job kept waiting to retry and took up one of the available job slots.

I ended up changing the flow so only one job at a time would process but because the 503 errors kept occuring throughout the day I had to manually remove some jobs.

Will the job stay active during the wait time for retry or should a slot be released for other jobs in the flow?

Re: HTTP Get Request 5xx response

Posted: Fri Oct 13, 2023 10:46 am
by freddyp
Jobs are not active, i.e. they do not take up a processing slot, when they are waiting in front of an element in a fail state. If you have proof of the contrary please report that to support.

Re: HTTP Get Request 5xx response

Posted: Mon Jan 15, 2024 9:29 am
by Jiyahana
Try implementing a retry mechanism with exponential backoff. This helps in managing intermittent server issues and implementing a timeout mechanism to prevent jobs from becoming stuck indefinitely. Ensure proper error handling and job cleanup procedures to free up concurrent job slots.