Repository navigation
shutdown migrationComponentsInitializer within gracefulShutdown - #1702
Conversation
| // Stop accepting new leases. Once we do this we can be sure that | ||
| // no more leases will be acquired. | ||
| // | ||
| migrationComponentsInitializer.shutdown(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.