TimeoutException - Contest Entries Failing

Hello Q community.
My contest algos are getting kicked out of the contest due to timeout exceptions 5 days after they begin receiving a score.
Contest Entry Stopped - "TimeoutException: Too much time spent in handle_data and/or scheduled functions. 50 second limit exceeded.".
These errors are occurring from within functions like the one below and they don't occur at the same location of my code or within the same function for that matter. Also, these functions are successfully executing on the days prior to the failure, so I don't think it's my code that is crashing.
schedule_function(Basic_Materials1, date_rules.every_day(),time_rules.market_open(minutes=1))
In Quantopian's backtest environment each of these functions take between 24-38 seconds to execute over 1000's of observations.
Apparently, the contest environment runs differently than the backtest environment. I have no idea how though and therefore I'm not sure of how to compensate for the discrepancy.
Have you encountered this issue? Were you able to figure out why? Would you kindly share an approach you took to resolve this?
Any information might help.
Searching the Q forums shows other users encountering this same problem, but I'm not seeing a fix.
And, I can't toss my code into "before_trading_start", because it takes longer than 5 minutes to run.
Thank you

3 responses

Happens to me as well way too frequently. They don’t seem to be isolated incidents either but rather a symptom of some underlying problem. Is there a root cause analysis done so the appropriate preventive, detective, and corrective controls can be identified, prioritized, and implemented? I’d hope so but so far there’s no evidence of this, or we’re just intentionally kept in the dark for whatever reason. The only tactical circumventive measure that I’m aware of is to ask QSupport to recertify the strategy. Not very sustainable, strategic, or scalable unfortunately.

We've recently implemented a fix that may help with some before_trading_start` timeout issues -- please see the original post here for more information.