Closed klin333 closed 2 years ago
This seems well reasoned. It would probably help if @johnlaing or @armstrtw could confirm the behavior.
I'll try to look into this.
Behavior confirmed. The problem with debugging timeout errors is it takes forever to trigger them.
Hi,
If we make a big bdh request, Rblpapi::bdh can hang in an infinite loop, without ever returning data or throwing an error. Indicative reproducable example below. From experimenting, it appears if a single request takes more than 10 mins server side, there is a time out that Rblpapi does not catch.
The Bloomberg developer guide https://data.bloomberglp.com/professional/sites/10/2017/03/BLPAPI-Core-Developer-Guide.pdf page 73 says
In bdh message processing loop, if server side crashed and refuses to ever return a RESPONSE event, then rblpapi will be stuck in an infinite loop. Currently there is no server timeout error handling in this loop. After experimenting with debug prints, I am certain that in the event of a long running query, about more than 10 mins, server returns an event of type 4 ie Event::REQUEST_STATUS. Then, server never returns Event::RESPONSE, hence our loop hangs infinitely. Full error message below.
https://github.com/Rblp/Rblpapi/blob/e5ca48a0089ac53919d8cba6758ae13732b55b09/src/bdh.cpp#L160-L176
I suggest we add a case to the event loop in bdh.cpp, eg
It's probably safer to also check for the response_type of "RequestFailure" as specified by the Bloomberg developer guide. However, I couldn't figure out the c++ code to check for that.
Arguably we can add this check in other event processing loops such as in bds.cpp. However, I can't see those requests ever taking 10 mins each. It appears only bdh has the potential to take so long because we jam pack all securities and all fields into 1 single bdh request.