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

12 hour inactivity shutdown #919

Merged
merged 3 commits into from
Oct 17, 2022
Merged

12 hour inactivity shutdown #919

merged 3 commits into from
Oct 17, 2022

Conversation

JackUrb
Copy link
Contributor

@JackUrb JackUrb commented Oct 12, 2022

Overview

In the vein of #918 and trying to improve the negative impact of the long tail of failure cases, this feature sets a configurable submission_patience, which automatically shuts down a Mephisto TaskRun when no submissions have come through in (by default) 12 hours. This should capture when a task is available but can't be completed (due to a bug in the code, an onboarding that's impossible, pairing problems, etc) and take a task offline before it wastes workers' time.

Implementation

  • Adds a no_submission_patience argument to TaskRunArgs
  • Adds a last_submission_time attribute to the ClientIOHandler which is updated every time a submission packet comes in.
  • updates Operator._track_and_kill_runs to also see if the patience is exceeded as an option for shutting down a task.

Testing

Current automated tests pass, and a new test is added for this case too.

@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 Oct 12, 2022
@JackUrb
Copy link
Contributor Author

JackUrb commented Oct 12, 2022

@mojtaba-komeili this type of feature would have been useful for damage control on your issue (though hopefully #911 is helping on the exploration part of that front).

@@ -261,6 +261,50 @@ def test_run_job_not_concurrent(self):
assignment = task_run.get_assignments()[0]
self.assertEqual(assignment.get_status(), AssignmentState.COMPLETED)

@patch("mephisto.operations.operator.RUN_STATUS_POLL_TIME", 1.5)
def test_patience_shutdown(self):
"""Ensure that a job can be run that doesn't require connected workers"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure id this is the right docstring for this test function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

Copy link
Contributor

@mojtaba-komeili mojtaba-komeili left a comment

Choose a reason for hiding this comment

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

Thanks for adding this. It is needed a lot of times specially when running over weekends and there is hours of no activity.

@codecov-commenter
Copy link

Codecov Report

Base: 64.61% // Head: 64.61% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (c69ae90) compared to base (fdf633d).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #919   +/-   ##
=======================================
  Coverage   64.61%   64.61%           
=======================================
  Files         108      108           
  Lines        9329     9335    +6     
=======================================
+ Hits         6028     6032    +4     
- Misses       3301     3303    +2     
Impacted Files Coverage Δ
mephisto/data_model/task_run.py 85.18% <100.00%> (+0.53%) ⬆️
mephisto/operations/client_io_handler.py 83.93% <100.00%> (+0.13%) ⬆️
mephisto/operations/operator.py 69.36% <100.00%> (+0.52%) ⬆️
mephisto/abstractions/architects/mock_architect.py 88.23% <0.00%> (-2.62%) ⬇️
...ractions/blueprints/mixins/screen_task_required.py 74.48% <0.00%> (-0.26%) ⬇️
mephisto/utils/metrics.py 29.32% <0.00%> (+0.21%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@JackUrb JackUrb merged commit 51a9e75 into main Oct 17, 2022
@JackUrb JackUrb deleted the 24-hour-shutdown branch October 17, 2022 21:37
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.

4 participants