Open nabicht opened 6 years ago
As of flask 1.0 threaded=True by default when start a Flask app. This is causing each request to be its own thread and the TaskManager is not at all thread safe.
The quick and dirty fix to is to explicitly set threaded=False. This alleviates the problem for now but isn't the end all be all fix for a couple of reasons:
Everything is done just in python objects in-memory right now, with zero persistence. I'm possibly moving to sqlite as a way to get persistence. I need to double check everything before hand, but I think I can use sqlite as a way to be thread safe as well, which would be an added benefit.
This really shouldn't happen and it is happening occasionally. 2 attempts are getting handed out back to back for the same task, and based on the logs it is happening right on top of each other.