-
Notifications
You must be signed in to change notification settings - Fork 106
Add cc uploader configurable drain timeout #562
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
base: develop
Are you sure you want to change the base?
Conversation
- Add `capi.cc_uploader.cc_uploader_drain_timeout_in_minutes` (type: time, default: 15m) to job spec - Inject `--shutdownTimeoutInMinutes=<%= p("capi.cc_uploader.cc_uploader_drain_timeout_in_minutes") %>` into `bpm.yml.erb` - Update `drain.sh.erb` to read the same property, apply the timeout when waiting for PID exit - Retain 15-minute fallback in the script for robustness against missing property values
b7f8344
to
ae3cd55
Compare
NOW_TS=$(date +%s) | ||
ELAPSED=$(( NOW_TS - START_TS )) | ||
if [ "$ELAPSED" -ge "$DRAIN_TIMEOUT" ]; then | ||
echo "$(date): drain timeout reached after ${DRAIN_TIMEOUT}s, forcing exit" >> "$LOG_FILE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So here the timeout is reached and the process has not yet exited. Is it correct to exit the drain script with 0 and send 0 to BOSH in that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in this case it is correct, the drain script is not failing, the upload is just taking too long, so we waited for 15 minutes and then we let bosh go ahead and stop the jobs, which adds another 60s waiting time. If the upload does not finish in that time, diego will send another upload request to another VM.
5501cd8
to
821b3d5
Compare
capi.cc_uploader.cc_uploader_drain_timeout_in_minutes
(type: time, default: 15m) to job spec--shutdownTimeoutInMinutes=<%= p("capi.cc_uploader.cc_uploader_drain_timeout_in_minutes") %>
intobpm.yml.erb
drain.sh.erb
to read the same property, apply the timeout when waiting for PID exitThanks for contributing to the
capi_release
. To speed up the process of reviewing your pull request please provide us with:A short explanation of the proposed change:
Allow operators to tune how long the CC-Uploader waits for in-flight uploads to finish during drain by introducing a new BOSH property (capi.cc_uploader.cc_uploader_drain_timeout_in_minutes) with a sane default of 15 minutes, wiring it through both the BPM startup flags and the drain script.
An explanation of the use cases your change solves
Let operators configure how long CC-Uploader waits (with a default of 15 minutes) during VM shutdown so active uploads complete gracefully.
Links to any other associated PRs
Improve droplet upload draining cc-uploader#245
I have viewed signed and have submitted the Contributor License Agreement
I have made this pull request to the
develop
branch[] I have run CF Acceptance Tests on bosh lite