hltcoe / turkle

Django-based clone of Amazon's Mechanical Turk service running in your local environment.
https://turkle.readthedocs.io
Other
147 stars 47 forks source link

Fixes #79 force query set evaluation to avoid race condition #117

Closed cash closed 3 years ago

cash commented 3 years ago

This fixes the race condition when two uses click on the accept next task button at the same time.

cash commented 3 years ago

As an FYI - the first commit prevents anyone from accepting any task for that batch during the transaction. The other requests will wait for the transaction to finish before completing. If we wanted to change that, we would need to limit the number of tasks that we pull back for assignment when locking. The reason we don't do that right now is because have to handle skipped tasks. The processing of filtering out skipped tasks happens after the lock is placed on all possible tasks.