When fetching daily prices for 200 bonds using ISIN identifier, usual time taken is around 40 seconds, but sometimes the request takes around an hour and returns either "Backend error. 400 Bad Request" or "Asynchronous Query library internal error".
API Logs attached.
Code used
When same request is retried either it fails with same error (but will not take this long to respond) or may succeed with response time being the usual of around 40 seconds.
Is there a way to timeout the request after a certain configured time instead of waiting for an hour to get an error as response and retry? Or the only option is for client/caller to run the request in a thread with timeout? During retry does it help to close the session and reopen a new session?