addisonlynch / iexfinance

Python SDK for IEX Cloud
https://addisonlynch.github.io/iexfinance
Apache License 2.0
648 stars 136 forks source link

`get_historical_intraday` hangs #255

Open kmyi opened 3 years ago

kmyi commented 3 years ago

Summary (include Python version)

I've been using iexfinance without any trouble, but recently I've started getting hangs in the get_historical_intraday function. It gets stuck there forever without recovering, so I've currently wrapped this call under a subprocess worker, which also failed today.

Python version 3.8. Upgrades iexfinance to 0.5 today, so not sure if this will happen again in the recent version.

Date/time of issue

Recently. Happened on Nov 18th, and also Jan 5th (happened also within this interval, but I implemented a workaround)

Expected behaviour

get_historical_intraday gracefully terminates with a timeout error, or some error message showing what is going on.

Actual behaviour

It gets stuck there forever without recovering, so I've currently wrapped this call under a subprocess worker and forced a timeout as below

iex_worker = self.iex_worker_pool.apply_async(
    get_historical_intraday,
    (contract.symbol,),
    {"token": self.iex_key},
)
iex_data = iex_worker.get(timeout=5)

This workaround allowed it to work more-or-less as this "hang" was rare, but today the worker timeout consistently happened for about an hour and a half. Since this happens very rarely, I wonder if this is happening only to me, or whether this is a problem going on at IEX.