Expose helper to construct dropped messages in accumulator (Message.to_drop(datum)) #357
Description
Summary
Expose a helper method on Message to construct a dropped message from a Datum, so users can explicitly emit drops from an accumulator (and other UDFs) to allow the watermark to progress and tracked windows/messages to be cleaned up.
Proposed signature:
Message.to_drop(datum)Internally, this should construct a Message from the given Datum and set the drop tags on it, so the message is not forwarded to the next vertex but still allows the accumulator to advance the watermark and release tracked state.
Motivation
Today there is no clean way for an accumulator to signal "I have handled this datum but don't want to forward it." Users that omit output for some inputs (e.g. blackhole/filter/multiplexer-style accumulators) end up retaining tracked windows and messages, which leads to unbounded memory growth.
Related: #356
Proposed API
def my_accumulator(datums, output):
async for datum in datums:
if should_drop(datum):
await output.put(Message.to_drop(datum))
continue
...Acceptance criteria
-
Message.to_drop(datum)constructs aMessagefrom aDatumwith drop tags set. - Emitting such a message from an accumulator progresses the watermark and cleans up tracked windows/messages.
- Message is not forwarded to the next vertex.
- Unit tests covering accumulator drop behavior.
- Example/docs updated to show the drop pattern.
Activity
vaibhavtiwari33 commentedon Jun 17, 2026
Not required anymore: numaproj/numaflow-java#218 (comment)
th0ger commentedon Sep 3, 2026
Hi @yhl25, @vaibhavtiwari33.
Can you explain why this changes is marked not needed?
We actually encounter the case described by OP, i.e. accumulator discarding selected events and output watermark not progressing.
It was fixed in our end by
The syntax would be clearer if
accumulator._dtypes.Message.to_drop()received a watermark arg.vaibhavtiwari33 commentedon Sep 3, 2026
Could you please specify the version being used here? The reasoning behind not adding the api can be found here
th0ger commentedon Sep 4, 2026
We're on latest
numaflow 1.8.3andpynumaflow 0.14.0.The EOF implementation described in pynumaflow-go did not progress our watermarks. They were just stuck, and the
pipeline_processing_lagkept growing indefinitely (hours and days).After adding above
DROPcode, the watermark progresses.vaibhavtiwari33 commentedon Sep 4, 2026
That would be a bug IMO, would it be possible for you to create a bug report for this to allow us looking into this further?
vaibhavtiwari33 commentedon Sep 21, 2026
numaproj/numaflow#3645 (comment)