Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing improper agent state transitions #366

Merged
merged 3 commits into from
Jan 22, 2021
Merged

Conversation

JackUrb
Copy link
Contributor

@JackUrb JackUrb commented Jan 21, 2021

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:

  • The routing server would sometimes have stale information, and this information was getting sent back to the main mephisto server and putting the wrong state up.
    • Now this is updated to only check for DISCONNECT changes, as this is the only status that the server will ever have that Mephisto needs to read, and anything else causes Mephisto to send a status update to sync the server.
  • When a task was returned, the MTurkUnit that marked this return would move directly from ASSIGNED to LAUNCHED, as this is the MTurk HIT status that we use to note a return event in the first place.
    • We now defer the local transition from ASSIGNED back to LAUNCHED, as the Blueprint will decide shortly after the RETURNED status is set whether the Unit needs to be expired. If it does, the Unit will end up in an EXPIRED status, otherwise the Blueprint will call clear_assigned_agent to move the Unit from ASSIGNED back to LAUNCHED

Testing

I was able to reproduce these state issues before this set of changes, but can no longer recreate them on this branch.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 21, 2021
mephisto/data_model/unit.py Outdated Show resolved Hide resolved
Copy link

@jxmsML jxmsML left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing this!!! Only one nit to be fixed.

@JackUrb JackUrb merged commit 1ecab21 into master Jan 22, 2021
@JackUrb JackUrb deleted the server-status-change-fixes branch January 22, 2021 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants