Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Pipeline timeout issues

Hello,

I am consistently getting timeout issues when backtesting an algorithm that uses the pipeline api. The issues are happening intermittently, sometimes my backtest completes and sometimes it does not. The errors I am getting are the following,

InterfaceError: connection already closed  
There was a runtime error on line 155.  

or

TimeoutException: Call to before_trading_start timed out  
There was a runtime error on line 155.  

Not sure what the issue is. Could someone please assist.

Regards,
Mark

3 responses

Hi Mark,

These are indeed intermittent issues with our database. I don't have more information right now but we are looking into it. I'll update you when we know more.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

I've experienced pretty wide variances in runtime (and timeout probability), which correlate with the time of day. At night my backtest invariably times out. Daytime I have no problems.

Sunil

I'm having the same problems randomly :(

Weirdly I get this error more often if I use LESS computing power. When I run the pipeline daily in "before_trading_start" I get the error rarely. When I schedule it once a month I get the error all the time :S Actually I now get a different error when I schedule the (heavy) pipeline processing to take place only once a month (before the rebalance function is called):
TimeoutException: Too much time spent in handle_data and/or scheduled functions. 50 second limit exceeded.

If I put the exact same pipeline processing code into before_trading_start() the code runs extremely slow but works without errors.

This seems like a bug? Why would Quantopian motivate/force people to run extremely heavy code daily when it's not necessary for the functionality of the script?

Why does a scheduled function have a time limit while a "before_trading_start" function doesn't have a time limit?