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

Stop container workers cleanly #17042

Merged
merged 2 commits into from
Feb 26, 2018
Merged

Conversation

carbonin
Copy link
Member

Before this, when #stop_worker was called, we would attempt to scale the deployment. This would work if we had a different number (or zero) workers configured in the settings, but we don't shut workers down like that when shutting down the server to preserve the user's settings for the next startup.

This resulted in worker pods not exiting when the orchestrator pod stopped and much confusion when the next orchestrator started up.

Additionally, this PR implements some error catching for the ContainerOrchestrator which we need because requests to remove resources from OpenShift are asynchronous.

Before this, when #stop_worker was called, we would attempt to scale
the deployment. This would work if we had a different number (or zero)
workers configured in the settings, but we don't shut workers down
like that when shutting down the server to preserve the user's settings
for the next startup.

This resulted in worker pods not exiting when the orchestrator pod
stopped and much confusion when the next orchestrator started up.
This will happen from time to time as we're calling #delete_container_objects
on each worker instance.

The calls to OpenShift are asynchronous so the next worker we tell
to #delete_container_objects may try to delete objects that have
already been removed.

Additionally, this makes it difficult to track when objects have
been deleted. Ideally we would scale a deployment down and have the
last worker delete the deployment iteslf, but a previous worker may
not have deleted the worker record by the time we tell the next worker
to exit.
@miq-bot
Copy link
Member

miq-bot commented Feb 23, 2018

Checked commits carbonin/manageiq@272a7ee~...6f52ccb with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@bdunne bdunne merged commit 136ca2b into ManageIQ:master Feb 26, 2018
@bdunne bdunne added this to the Sprint 80 Ending Feb 26, 2018 milestone Feb 26, 2018
@carbonin carbonin deleted the stop_container_worker branch August 16, 2019 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants