wait for 15 seconds , then timeout. simple get_data queries. why?

2022-03-31 10:40:06,005 - MainThread - INFO - json_requests - 174 - _check_ticket_async - Receive ticket from responses, wait for 15.0 seconds

2022-03-31 10:40:21,392 - MainThread - INFO - json_requests - 174 - _check_ticket_async - Receive ticket from responses, wait for 15.0 seconds

2022-03-31 10:40:36,953 - MainThread - INFO - json_requests - 174 - _check_ticket_async - Receive ticket from responses, wait for 15.0 seconds

2022-03-31 10:40:52,589 - MainThread - INFO - json_requests - 174 - _check_ticket_async - Receive ticket from responses, wait for 15.0 seconds

2022-03-31 10:41:08,230 - MainThread - INFO - json_requests - 174 - _check_ticket_async - Receive ticket from responses, wait for 15.0 seconds

2022-03-31 10:41:24,732 - MainThread - INFO - json_requests - 174 - _check_ticket_async - Receive ticket from responses, wait for 15.0 seconds

2022-03-31 10:41:40,388 - MainThread - INFO - json_requests - 174 - _check_ticket_async - Receive ticket from responses, wait for 15.0 seconds

2022-03-31 10:42:10,404 - MainThread - ERROR - json_requests - 130 - send_json_request - HTTP TimeoutException: .

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @mjg

    The request (wait for 15.0 seconds) didn't fail. I think that you may request a lot of data points and it takes some time to extract all the requested data.

    The endpoint is asynchronous so it will send a response back to the API with the ticket number to indicate that the extraction is still in progress. Then, the API uses that ticket to query for the status and data. You will get the data when the extraction is complete.

    You may try to reduce the size of the requested data. However, if you requested a small set of data, it could be a problem on that server at that time.

Answers

  • Hi @mjg ,

    timeout can be set with higher value than 120 sec:

    ek.set_time_out(300)  # it will set timeout to 5 min


  • @pf thanks i'll try that - is there any reason 15 seconds would fail repeatedly on a simple query? is it worth investigating that so that i better understand determinism of normal latency?

  • Hi @mjg ,

    The request is managed server side and we need to request for the result in a second step.
    15 seconds is the delay the Python lib is using between 2 retries when it requests for the result. It doesn't fail repeatdly, each request is logged as INFO (and not as an error):
    2022-03-31 10:41:40,388 - MainThread - INFO - json_requests - 174 - _check_ticket_async - Receive ticket from responses, wait for 15.0 seconds

    The global timeout for the user could force a TimeoutException when it takes too much time to compute the result server side. That's why you had it:
    2022-03-31 10:42:10,404 - MainThread - ERROR - json_requests - 130 - send_json_request - HTTP TimeoutException:
    If you don't mind the request's duration, you can set timeout with more than 300 seconds.