Closed mrhappyasthma closed 2 years ago
It's possible it's a race condition. I don't synchronize accesses/mutations of self.ratios
.
Testing a fix locally. I can't be positive if it's the fix, but running over 8000 queries to ensure it doesn't crash once.
This seems like a potential preventative fix.
According to here, this may have been introduced by mutating the request headers: https://stackoverflow.com/a/20457621/1366973
Adding a simple lock seems to be reasonable fix, and have not yet witnessed the crash.
Not exactly sure how it's possible to crash on this line: https://github.com/mrhappyasthma/IsThisStockGood/blob/master/src/DataFetcher.py#L204
When we ensure it's non-nil here: https://github.com/mrhappyasthma/IsThisStockGood/blob/master/src/DataFetcher.py#L202