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

Add graceful shutdown to worker instances #1394

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SchahinRohani
Copy link
Contributor

@SchahinRohani SchahinRohani commented Oct 4, 2024

Description

This PR implements graceful shutdown for worker instances to ensure that the scheduler is properly notified when workers are shutting down.

How Has This Been Tested?

bazel test ...

Checklist

  • Updated documentation if needed
  • Tests added/amended
  • bazel test //... passes locally
  • PR is contained in a single commit, using git amend see some docs

This change is Reviewable

Copy link
Member

@adam-singer adam-singer left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 6 files at r1, all commit messages.
Reviewable status: 0 of 1 LGTMs obtained, and 3 of 6 files reviewed, and 3 discussions need to be resolved


nativelink-worker/src/local_worker.rs line 486 at r1 (raw file):

    pub async fn shutdown(&self) {
        println!("Shutting down worker: {}", self.name());

should be a tracing log statement and not println statements, for example


nativelink-worker/src/local_worker.rs line 488 at r1 (raw file):

        println!("Shutting down worker: {}", self.name());

        let max_wait_duration = Duration::from_secs(60);

I think this would be better named as a shutdown deadline and a configuration option. I wonder if this would get out of sync with request timeouts and cause hard to catch behavior if shorter than upstream timeouts.


nativelink-worker/src/local_worker.rs line 525 at r1 (raw file):

            } else {
                println!("No worker_id available; cannot notify scheduler.");
                return;

This would be panic or return Err / make_err type situation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants