Skip to content

fix(insight): buffer on-change export bursts - #713

Closed
wangyb-A wants to merge 13 commits into
feat/insight-async-exportfrom
fix/insight-export-fifo
Closed

wangyb-A wants to merge 13 commits into
feat/insight-async-exportfrom
fix/insight-export-fifo

Conversation

@wangyb-A

@wangyb-A wangyb-A commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #702 (feat/insight-async-export). This preserves ordinary on-change bursts without weakening the base scheduler's timeout, retained-memory, or exporter-ownership bounds.

What changed

  • keep a bounded FIFO of 16 pending snapshots per execution ARN
  • keep at most 1,024 pending records and 16 MB of estimated retained memory per lane
  • serve ARNs round-robin while evicting by true record age
  • split pre- and post-flush work with generation-specific queue tokens
  • preserve generation order after a timed-out flush barrier is canceled
  • preserve exporter shaping for custom-renderable, safe opaque, and non-JSON records
  • reject an individually over-budget record without evicting accepted same-ARN FIFO snapshots or unrelated backlog
  • contain retained-size inspection failures as ordinary over-budget rejection
  • disable failed-start lanes while clearing FIFO tokens, records, bytes, and barriers
  • coalesce timed-out flushes to one detached marker after the bounded caller wait
  • document lane-wide flush behavior for batching exporters

Why

Tight Python hook bursts could overwrite every intermediate RUNNING snapshot before the daemon worker received a turn. A single latest-pending slot therefore made on-change behave like on-complete during parallel/map fan-in and warm replay.

The FIFO keeps normal bursts observable. Record-count and retained-memory caps keep blocked lanes bounded. Generation tokens keep invocation-end barriers between the records they must flush and later records they must not flush.

Validation

  • full Insight suite: 153 passed, including local-runner e2e
  • real DurableFunctionTestRunner parallel fan-in verifies four RUNNING snapshots followed by terminal completion
  • fan-in e2e passed 10 repeated runs and was proven to fail the old latest-only scheduler
  • exact-age eviction, pre/post-barrier, canceled-barrier recovery, pending-plus-in-flight accounting, slice-referent sizing, non-dispatched sizing, two-barrier-race, accepted-FIFO preservation, safe-opaque-rendering, inspection-failure, startup-failure, cleanup, and ownership regressions passed
  • focused scheduler/plugin/fan-in suite: 61 passed
  • focused ordering regressions repeated 20 times
  • mypy passed
  • Ruff lint and format passed
  • wheel and sdist built
  • full repository collection completed without errors
  • prior Workflow Insight conformance remains CloudWatch 18/18 and S3 18/18
  • exact-SHA local correctness review at d876e48: all blocker classes closed; no remaining or new Critical/High findings

no linked issue: #687 tracks broader Workflow Insight follow-up work

@wangyb-A
wangyb-A added this pull request to stack #715 September 9, 2026 20:33
@wangyb-A
wangyb-A force-pushed the feat/insight-async-export branch from 06c4beb to 12acbb4 Compare September 9, 2026 20:33
@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 4dfba11 to efae931 Compare September 9, 2026 20:34
@wangyb-A
wangyb-A force-pushed the feat/insight-async-export branch from 56e69d3 to e6f1016 Compare September 9, 2026 20:58
@wangyb-A

wangyb-A commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

/ai review

@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 00c4323 to c4d5565 Compare September 9, 2026 22:19
@wangyb-A
wangyb-A marked this pull request as ready for review September 9, 2026 22:43
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 9, 2026 22:43 — with GitHub Actions Active
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 9, 2026 22:55 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 33aebd0 to ed394bf Compare September 10, 2026 00:09
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 00:11 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 00:31 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 864c423 to 1f33def Compare September 10, 2026 00:59
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 01:02 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 1f33def to 687d450 Compare September 10, 2026 01:27
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 01:34 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 687d450 to 6f05178 Compare September 10, 2026 01:59
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 01:59 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 6f05178 to 7889474 Compare September 10, 2026 02:20
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 02:20 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 7889474 to f91e2eb Compare September 10, 2026 02:42
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 02:43 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 02:53 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 7ee43b7 to 5558c18 Compare September 10, 2026 03:03
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 03:04 — with GitHub Actions Active
@github-actions

This comment has been minimized.

@wangyb-A
wangyb-A force-pushed the fix/insight-export-fifo branch from 5558c18 to d876e48 Compare September 10, 2026 03:25
@wangyb-A
wangyb-A deployed to ai-pr-review-runtime September 10, 2026 03:25 — with GitHub Actions Active
daemon=True,
)
run_thread.start()
try:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex AI review · Finding arf_v1_dmyq7d5h3r3s5adl2jgaghrhgf

[P2] Avoid assuming exactly three operation-change batches. The checkpoint batcher closes batches using an idle timeout, so six concurrent branches can legitimately produce a different number of OperationChangeInfo hooks depending on thread scheduling. The pending count may skip past 4, causing this wait and the fixed five-record assertion below to fail despite correct FIFO behavior. Record the actual hook count with a probe plugin, signal after invocation end, and assert one exported snapshot per observed start/change/end hook instead of hard-coding the count.

@github-actions

Copy link
Copy Markdown
Contributor

Codex AI review

One P2 test-stability issue: the new fan-in e2e assumes a fixed number of timing-dependent checkpoint batches.

Reviewed commit d876e48a82b3b04bac18689b965fcf561f007b74. Workflow run

@wangyb-A wangyb-A closed this Sep 10, 2026
@wangyb-A
wangyb-A removed this pull request from stack #715 September 10, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant