Removing improper agent state transitions #366
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Thanks to @jxmsML, I was able to identify a few state transitions that were occurring that shouldn't have been happening. Each were problematic, and in total they meant that human-human chat tasks would freeze up after the first occurrence of two people leaving a chat at roughly the same time (within 2 mins of each other, the average time for MTurk to mark a return).
This fix addresses the two following issues:
MTurkUnit
that marked this return would move directly fromASSIGNED
toLAUNCHED
, as this is the MTurk HIT status that we use to note a return event in the first place.ASSIGNED
back toLAUNCHED
, as theBlueprint
will decide shortly after theRETURNED
status is set whether theUnit
needs to be expired. If it does, theUnit
will end up in anEXPIRED
status, otherwise theBlueprint
will callclear_assigned_agent
to move theUnit
fromASSIGNED
back toLAUNCHED
Testing
I was able to reproduce these state issues before this set of changes, but can no longer recreate them on this branch.