Skip to content

shutdown migrationComponentsInitializer within gracefulShutdown - #1702

Merged
vincentvilo-aws merged 6 commits into
awslabs:masterfrom
vincentvilo-aws:master
Feb 23, 2026
Merged

vincentvilo-aws merged 6 commits into
awslabs:masterfrom
vincentvilo-aws:master

Conversation

@vincentvilo-aws

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes: Shutdown components within the initializer as part of graceful shutdown

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

// Stop accepting new leases. Once we do this we can be sure that
// no more leases will be acquired.
//
migrationComponentsInitializer.shutdown();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should shutdown migrationStateMachine as well. Seems like migrationComponentsInitializer.shutdown should also set initialized = false and if its false not do the shutdown process again since it will do it during scheduler shutdown too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added the migrationStateMachine.shutdown() to the graceful shutdown.

I was looking at the shutdown logic for each component and it looks like there's already logic that checks whether the component was already shutdown. Do we still need to set initialized to false even if we have logic within each component that handles redundant calls?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will prevent leases to be assigned to the worker after worker is deemed to be expired. But during that time leases can still be assigned, maybe ideally we want to explicitly indicate that worker is shutting down. Could again come as an iterative improvement once this change is merged.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

from what I saw migrationComponentsInitializer.shutdown will go through the shutdown process again if its called again, it does not set initialized to false therefore prevent going through shutting down sequence. I was referring to setting initialized to false for that reason.

@vincentvilo-aws
vincentvilo-aws merged commit bdb8f68 into awslabs:master Feb 23, 2026
6 checks passed

This branch was previously deployed

1 inactive deployment
manual-approval β€” 9bea6a06 Deployed Feb 19, 2026 by vincentvilo-aws via wait-for-approval #70
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