Add draining for cc uploader #4296
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.
Enhance droplet upload to be more resilient:
Add shutdown logic for cc_uploader process in Drain class
A short explanation of the proposed change:
The proposed change adds a new method
shutdown_cc_uploader
to theDrain
class. This method handles the graceful and forceful shutdown of thecc_uploader
process. It sends aTERM
signal to initiate the shutdown and waits for the process to terminate. If the process does not terminate within the specified timeout (900 seconds), it sends aKILL
signal to forcefully shut it down. The method also logs appropriate messages during the shutdown process.An explanation of the use cases your change solves
If api VM gets stopped and starts draining, give upload jobs the chance to finish upload, initiate a graceful shutdown, allowing the process to terminate cleanly.
Links to any other associated PRs
Add draining for cc_uploader capi-release#529
More resilient droplet upload cc-uploader#195
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
main
branchI have run all the unit tests using
bundle exec rake
I have run CF Acceptance Tests