Add draining for cc_uploader #529
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cc-uploader previously lacked a proper draining mechanism. With PR #195, draining is now implemented, allowing upload jobs to complete gracefully before the process is stopped.
In addition, PR #4296 introduces support in the Cloud Controller API VM's drain script to coordinate the shutdown of the cc-uploader process.
To ensure proper shutdown ordering, this change:
This ensures that cc-uploader, which polls job status from cloud_controller_ng, is drained before cloud_controller_ng or nginx_cc are stopped.
Dependency Behavior
cc_uploader starts only after cloud_controller_ng is running.
Stopping cloud_controller_ng also stops cc_uploader.
Stopping cc_uploader does not affect cloud_controller_ng.
Restarting cloud_controller_ng may also restart cc_uploader.
cc_uploader can restart independently, as long as cloud_controller_ng is available.
A short explanation of the proposed change:
This change ensures that cc-uploader is gracefully drained before cloud_controller_ng or nginx_cc are stopped. It adds a shutdown step for cc-uploader in the API VM drain script and introduces a Monit dependency so that cc-uploader only runs when cloud_controller_ng is running.
An explanation of the use cases your change solves
Graceful Shutdown of cc-uploader:
Ensures ongoing app upload jobs have a chance to complete before cc-uploader is stopped, preventing potential job interruption or failure during deployments or VM shutdowns.
Correct Shutdown Order:
Prevents scenarios where cloud_controller_ng is stopped before cc-uploader, which would break the polling mechanism and cause uploads to fail.
Improved System Reliability During Drains:
By hooking cc-uploader into the API VM drain process and setting up the right Monit dependency, we make sure everything shuts down in the right order. This helps avoid weird edge cases during restarts or shutdowns and makes the system behave more consistently.
Links to any other associated PRs
More resilient droplet upload cc-uploader#195
Add draining for cc uploader cloud_controller_ng#4296
I have viewed signed and have submitted the Contributor License Agreement
I have made this pull request to the
develop
branchI have run CF Acceptance Tests on bosh lite