Adding --gcp-cloud-run-scale-down-wait-time flag - #1167
Conversation
|
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37bae511f3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| at least 0; 0 disables the quiet window. If omitted, the version's | ||
| existing scaling settings are left unchanged. Only valid with | ||
| --gcp-cloud-run-worker-pool. |
There was a problem hiding this comment.
Remove the worker-pool co-requirement from this help
For update-version-compute-config, this says the new flag is only valid when --gcp-cloud-run-worker-pool is supplied, but the command's documented and implemented scaler-only mode accepts the five scaler flags without any provider flags and updates only scaler.details. A user following this option-level help may unnecessarily supply all required provider fields and overwrite the provider configuration rather than performing the intended scaler-only update.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 99856f6bd4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| max: c.GcpCloudRunMaxInstances, maxSet: f.Changed("gcp-cloud-run-max-instances"), | ||
| initial: c.GcpCloudRunInitialInstances, initialSet: f.Changed("gcp-cloud-run-initial-instances"), | ||
| utilization: c.GcpCloudRunUtilizationTarget, utilizationSet: f.Changed("gcp-cloud-run-utilization-target"), | ||
| scaleDownWaitMs: c.GcpCloudRunScaleDownWaitTime.Duration().Milliseconds(), scaleDownWaitSet: f.Changed("gcp-cloud-run-scale-down-wait-time"), |
There was a problem hiding this comment.
Validate durations before truncating to milliseconds
When the flag is given a negative sub-millisecond value such as --gcp-cloud-run-scale-down-wait-time=-1us, Duration().Milliseconds() truncates it to zero, so the later negative-value check is bypassed and no_sync_quiet_ms: 0 is sent, disabling the wait instead of rejecting the input. Positive sub-millisecond values are likewise silently changed to zero; validate the original duration before converting (in both create and update helpers), and either reject or explicitly handle non-integral milliseconds.
Useful? React with 👍 / 👎.
99856f6 to
d8a362a
Compare
gcristea-temporal
left a comment
There was a problem hiding this comment.
This looks good, thank you for taking adding the extra argument.
Not sure whether my review approval alone is enough for you to merge.
|
please use the PR template that demos the UX difference. |
jaypipes
left a comment
There was a problem hiding this comment.
I would suggest using --scale-down-stabilization-window or --scale-down-stabilization-duration to align with the identical Kubernetes autoscaler settings.
Related issues
Closes: https://temporalio.atlassian.net/browse/COM-241
What changed?
Adds
--gcp-cloud-run-scale-down-wait-timetotemporal worker deployment create-versionand
temporal worker deployment update-version-compute-config.90s,5m), matching the CLI's convention fortime-valued flags (
cliext.FlagDuration, like--schedule-to-close-timeout,--retention, etc.). It joins the existing all-or-none GCP Cloud Run scalergroup, so
--gcp-cloud-run-min-instances,--gcp-cloud-run-max-instances,--gcp-cloud-run-initial-instances,--gcp-cloud-run-utilization-target, and--gcp-cloud-run-scale-down-wait-timemust all be set together.it may scale the Cloud Run worker pool down. Raising it keeps the pool from
scaling down before long-running or bursty activities finish. Defaults to
90swhen unset;
0sdisables the wait.scaler's existing
no_sync_quiet_msconfig key, which WCI already validates andapplies — no server-side change is required.
describe-versionsurfaces the value (JSONscaleDownWaitTimeMs, in ms, and theone-line compute-config summary).
This is a stopgap for long/bursty activities pending GCP's configurable graceful
shutdown; it is not itself graceful shutdown.
Checklist
Stability
-o json/-o jsonl) are treated as breaking changes — see note 1Design
temporal <noun> <verb>structure — no new commands; flag added to existing commandsscale-down-wait-timenames the user-facing behavior, not the internalno_sync_quiet_mskey(Experimental)incommands.yaml— both commands already carry a "This is an experimental feature" note in their descriptionsHelp text (see style guide at the top of
commands.yaml)--namespace, not-n), one flag per lineYourXxxform (YourWorkflowId,YourNamespace)Behavior
Tests
SharedServerSuite)func TestXxx) where applicableNotes for reviewer
describe-versiongains an additivescaleDownWaitTimeMsfield(milliseconds). The surrounding GCP scaler config block is not in a tagged
release yet, so no released output changes — hence not marked 💥.
no_sync_quiet_ms) and thedescribe output stay in milliseconds. Runtime effect on WCI was verified
separately via an in-process integration test in temporal-auto-scaled-workers
(confirms WCI reads the value and blocks scale-down with
scale_block_reason=no_sync_quiet); that test is not part of this CLI PR.Manual tests
Built locally, ran commands to review help info
WCI integration test locally to see changed values took effect
Once approved I'm going to test locally with a real Cloud Run deployment (don't want to test multiple times if there is any feedback - I'll address that first then test)