## What changed? `CHASMToLegacyStartScheduleArgs` (the CHASM-to-V1 rollback conversion) appends trigger-derived `BufferedStarts` after the regular pending ones unconditionally, without sorting by due time. Sort the combined list by `ActualTime` after appending, mirroring the sort already applied to `RecentActions` a few lines above in the same function. ## Why? V1's `processWatcherResult` (and the buffer-processing code generally) assumes `BufferedStarts[0]` is always the earliest-due pending start -- it has no equivalent of CHASM's `Attempt` field to reorder around, so it never needs to search for the right entry, unlike CHASM's own `invoker.go`. That assumption isn't guaranteed across a CHASM-to-V1 rollback: - `convertBackfillersCHASMToLegacy` builds `triggerStarts` from manual-trigger backfillers by iterating a Go map, whose iteration order is randomized -- with more than one pending trigger, their relative order isn't stable across calls. - `triggerStarts` are appended after the regular buffered starts regardless of their own due time. A manual trigger queued (and not yet drained) before rollback could have a due time earlier than an already-pending regular buffered start, landing it in the wrong position in the resulting V1 list. Found while reviewing the "legacy path doesn't use deferred starts, so `BufferedStarts[0]` is always the next pending start" invariant this comment documents (`service/worker/scheduler/workflow.go`) -- true for V1 running natively, but not rigorously guaranteed for state arriving via rollback. ## How did you test it? - [x] Added `TestCHASMToLegacyStartScheduleArgs_BufferedStartsSortedByActualTime`, constructing a manual trigger whose due time predates an already-pending regular buffered start; verified it fails without the fix (`the earlier-due manual trigger must sort first`) and passes with it. - [x] `go test ./chasm/lib/scheduler/...` - [x] `make lint-code` (golangci-lint, 0 new issues) ## Potential risks Low. This only reorders an in-memory slice being constructed fresh for a rollback's `StartScheduleArgs` -- it doesn't change what's already been recorded to history, and the sort key (`ActualTime`) is the same field V1 already uses everywhere else to mean "due time."
Temporal—durable execution platform
Introduction • Getting Started • Contributing • Temporal Docs • Temporal 101
Introduction
Temporal is a durable execution platform that enables developers to build scalable applications without sacrificing productivity or reliability. The Temporal server executes units of application logic called Workflows in a resilient manner that automatically handles intermittent failures, and retries failed operations.
Temporal is a mature technology that originated as a fork of Uber's Cadence. It is developed by Temporal Technologies, a startup by the creators of Cadence.
Getting Started
Download and Start Temporal Server Locally
Execute the following commands to start a pre-built image along with all the dependencies.
brew install temporal
temporal server start-dev
Refer to Temporal CLI documentation for more installation options.
Run the Samples
Clone or download samples for Go or Java and run them with the local Temporal server. We have a number of HelloWorld type scenarios available, as well as more advanced ones. Note that the sets of samples are currently different between Go and Java.
Use CLI
Use Temporal CLI to interact with the running Temporal server.
temporal operator namespace list
temporal workflow list
Use Temporal Web UI
Try Temporal Web UI by opening http://localhost:8233 for viewing your sample workflows executing on Temporal.
Repository
This repository contains the source code of the Temporal server. To implement Workflows, Activities and Workers, use one of the supported languages.
Contributing
We'd love your help in making Temporal great.
Helpful links to get started:
- work on or propose a new feature
- learn about the Temporal Server architecture
- learn how to build and run the Temporal Server locally
- learn about Temporal Server testing tools and best practices
- join the Temporal community forum and Slack