Skip to content

v0.105.13

@grutt grutt tagged this 28 Aug 19:57
* fix(engine): bind workflow event subscribe before OLAP wait

Attach the tenant stream first so chunks published during hydration are not dropped, and send a hangup instead of an empty OK when the run is already terminal.

* fix(engine): gate workflow event subscribe on core, not OLAP

Look up the run in v1_lookup_table and hang up from ListFinalizedWorkflowRuns so subscribe does not wait on the lagging OLAP projection.

* fix(engine): drain stream events before workflow hangup

Hangup was closing SubscribeToWorkflowEvents while out-of-order chunks were still in the reorder buffer or in flight across engine pods, which dropped stream payloads. Hold hangup until the buffer drains or a short quiet window elapses.

* fix(engine): use short TTL for tenant-stream publishes instead of 0

A per-message TTL of 0 drops fanout messages whenever the subscriber's
consumer is momentarily busy, which silently loses mid-stream chunks
during putStream bursts. Subscriber queues are exclusive + auto-delete,
so a 30s TTL bounds buildup while surviving those windows. Scheduler
partition wake-ups keep TTL 0 since their shared queue outlives its
consumer.

* more traces

* fix(engine): do not drop stream chunks that arrive after the terminal event

The step-run terminal event rides a separate per-msgId flush buffer, so it
can leapfrog late stream chunks. Its handler flushed buffered events and
deleted the expected-index state, so any straggler re-initialized the index
to 0, buffered against an impossible expectation, and was silently discarded
by periodicCleanup: the missing-chunk holes seen in production streams.

Keep index continuity with the -1 sentinel so post-terminal stragglers flow
through immediately, and make periodicCleanup flush leftovers instead of
discarding them.

* fix(engine): hold buffered stream chunks on terminal event to preserve order

Flushing buffered chunks past a hole when the terminal event arrived turned
late stragglers into out-of-order delivery: the straggler (no longer dropped)
was emitted after chunks with higher indexes. Instead, keep buffering on the
terminal event and let the straggler fill the hole so the buffer drains in
order. The hangup drain (holds the hangup until buffers empty) and
periodicCleanup (flushes leftovers after the grace period) still cover chunks
that never arrive.

* tighten flush loop

* fix(engine): do not broadcast DAG QUEUED->RUNNING as workflow-run-finished

notifyDAGsUpdated published every UpdateDAGStatuses row as
workflow-run-finished, including the QUEUED->RUNNING transition when a
DAG's first task starts. The dispatcher coerced the unknown RUNNING
status into COMPLETED, hanging up SubscribeToWorkflowEvents streams
~600ms after any DAG run started (any task with onFailure is a DAG).
Filter to terminal statuses like the task-side notifier, and drop
non-terminal statuses in the converter instead of defaulting to
COMPLETED.

* test: cover subscribeToStream DAG hangup and late-join cases

Reproduce the engine hanging up stream subscribers when a DAG run starts
(onFailure makes a task a DAG) and assert late joiners still receive the
tail instead of an empty close.

* fix workaround

* revert other fix

* tighten up some comments

* generate

---------

Co-authored-by: Julius Park <juliusgeo@gmail.com>
Assets 2
Loading