Repository navigation
Fix FirstWorkflowTaskBackoff Accumulation upon ContinueAsNew - #11839
Conversation
| lifetime := max(time.Duration(0), now.Sub(ms.executionState.StartTime.AsTime().UTC())) | ||
| if ms.executionInfo.ExecutionTime != nil { | ||
| lifetime = ms.timeSource.Now().Sub(ms.executionInfo.ExecutionTime.AsTime().UTC()) | ||
| executionLifetime := now.Sub(ms.executionInfo.ExecutionTime.AsTime().UTC()) |
There was a problem hiding this comment.
what is the definition of StartTime and ExecutionTime?
There was a problem hiding this comment.
StartTime is when mutable state record is created, ExecutionTime is when first workflow task is scheduled.
There was a problem hiding this comment.
I was wondering why it could be in the future. but it seems ExecutionTime is the planned time for the first workflow task, not the actual first workflow task schedule time.
There was a problem hiding this comment.
correct, that's planned time and update/signalWithStart today can bypass and schedule the first workflow task before that.
| lifetime := max(time.Duration(0), now.Sub(ms.executionState.StartTime.AsTime().UTC())) | ||
| if ms.executionInfo.ExecutionTime != nil { | ||
| lifetime = ms.timeSource.Now().Sub(ms.executionInfo.ExecutionTime.AsTime().UTC()) | ||
| executionLifetime := now.Sub(ms.executionInfo.ExecutionTime.AsTime().UTC()) |
There was a problem hiding this comment.
StartTime is when mutable state record is created, ExecutionTime is when first workflow task is scheduled.
b126a5e to
c06fcfc
Compare
## What changed? - Fix FirstWorkflowTaskBackoff Accumulation upon ContinueAsNew ## Why? - Today if workflow continueAsNew before executionTime, the calculated lifetime will be negative and causing backoff to keep accumulating via continueAsNew. ## How did you test it? - [x] built - [ ] run locally and tested manually - [ ] covered by existing tests - [x] added new unit test(s) - [x] added new functional test(s)
## What changed? Backports the remaining merged PRs labeled [release/1.32.0](https://github.com/temporalio/temporal/issues?q=state%3Aclosed%20label%3Arelease%2F1.32.0) onto release/v1.32.x, in main merge order: - [#11599](#11599) Optimize Visibility PostgreSQL upgrade schema v1.14 - [#11723](#11723) Validate history pagination branch token against mutable state - [#11800](#11800) Capture panics in Visibility query converter - [#11813](#11813) Capture panic in ServiceErrorInterceptor - [#11829](#11829) Return empty Elasticsearch page token when the result is smaller than the page - [#11839](#11839) Fix FirstWorkflowTaskBackoff accumulation upon Continue-As-New - [#11801](#11801) Fix Visibility SQL query conversion [#11265](#11265) and [#11564](#11564) were already present on release/v1.32.x and are not duplicated here. ## Testing - Targeted unit tests for Visibility query conversion, RPC interception, History branch-token validation, and Continue-As-New backoff - make GOLANGCI_LINT_FIX=false GOLANGCI_LINT_BASE_REV=origin/release/v1.32.x lint-code --------- Co-authored-by: Rodrigo Zhou <[email protected]> Co-authored-by: Prathyush PV <[email protected]> Co-authored-by: Yichao Yang <[email protected]>
What changed?
Why?
How did you test it?