Skip to content

fix: preserve supervised values shaped like child exits - #51

Merged
dbrattli merged 2 commits into
mainfrom
fix/supervised-payload-routing
Oct 18, 2026
Merged

dbrattli merged 2 commits into
mainfrom
fix/supervised-payload-routing

Conversation

@dbrattli

Copy link
Copy Markdown
Collaborator

Why

flatMapActorSupervised shares a monitor mailbox between upstream values and child-exit signals. On BEAM, Fable.Actor's structural exit check can misread a source record with Pid and Reason fields as an exit. An actual ChildExited source value collides on every target. Python subscription disposal also failed because a partially applied cleanup function compiled to a callable that still required an argument.

How

  • Wrap forwarded values in a private DU and classify the envelope before child exits. Unexpected monitor messages now surface as errors.
  • Split output delivery, monitor routing, child-exit decisions, and cleanup into focused helpers.
  • Pass an explicit zero-argument cleanup closure so Python disposal runs.
  • Add shared regressions for exit-shaped records, ChildExited values, mixed payloads, ordering, and disposal. Refresh the measured runtime counts.

Closes #27

@dbrattli
dbrattli merged commit 3364e37 into main Oct 18, 2026
5 checks passed
@dbrattli
dbrattli deleted the fix/supervised-payload-routing branch October 18, 2026 21:15
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.

BEAM: tryAsChildExited duck-typing can misread an upstream value as a child exit

1 participant