Multiple Sinks & Independent Completion #10
Labels
No labels
agent
blocked
agent
new
agent
review
agent
working
complexity
high
complexity
low
priority
high
priority
low
priority
medium
risk
high
risk
low
risk
medium
type
bug
type
chore
type
feature
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
tfks/logbus#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, any stage completing triggers downstream drain. With multiple sinks (e.g. write to both OpenSearch and a file), one finishing early would starve the other.
Proposed Approach
Tag stages with their role:
Source,Transform,Sink(already implicit in config viainputsand whether the stage has downstream consumers — make it explicit).Shutdown rule: The pipeline shuts down when all sources have completed OR when a shutdown signal arrives. Sinks complete independently when their input channel drains.
Fan-out to multiple sinks: When a transform feeds multiple sinks, each sink gets its own bounded channel. The transform sends to all of them. A sink completing and dropping its receiver doesn't affect the other sinks — the transform just stops sending to that edge.
Implementation sketch:
Per-sink completion callback: Add
on_complete()to the Plugin trait (default no-op) so sinks can report final stats without triggering pipeline shutdown.Edge Case: Sink Failure
If a sink errors out, it should log and drop its receiver. Other sinks continue. An optional
on_errorpolicy per sink (abort-pipeline|continue|retry) could be configured.