Repository navigation
Add endpoint-keyed flush for batching targets - #652
Closed
royischoss wants to merge 7 commits into
Closed
royischoss wants to merge 7 commits into
royischoss wants to merge 7 commits into
Conversation
…ng the logic needed to track in_flight and done events
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
davesh0812
approved these changes
Sep 15, 2026
Collaborator
Author
|
differed to next version of mlrun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an opt-in, endpoint-keyed flush fence to
ParquetTarget. This lets MLRun wait until all buffered and already-in-flight Parquet writes accepted for one model endpoint are durable, without flushing or blocking unrelated endpoints.Changes Made
flush_key_fieldconfiguration and public asyncParquetTarget.flush(flush_key)._emit_all()loop.BatchWriteCancelledError, report the real batch key and sequence in that message, and safely retain exceptions that cannot be copied.flush_key_fieldin the error when an event has no flush key, a wrong-typed key, or is missing the configured body field.ParquetTargetusers: move the_last_written_eventupdate out of_blocking_emit(executor thread) into_emit(event loop). It previously advanced even when the write failed, advanced before the file was closed, and raced between concurrent executor threads. Now it advances only after a successful write and stays monotonic.Out-of-scope change worth reviewing separately
storey/sources.pygains a_copy_exception_or_originalhelper and applies it to six pre-existingcopy.copycall sites inAwaitableResultandAsyncAwaitableResult. Those sites had the same latent bug fixed in the batching path: copying an exception whose__init__signature does not match itsargsraisesTypeErrorand replaces the real error. This is unrelated to batching, so reviewers of the source-side result paths should look at it on its own.Testing
make lint— passedpytest tests/test_batching_races.py— 34 passed, stable across multiplePYTHONHASHSEEDvaluespytest tests/test_flow.py— 289 passedRelated Issues
Additional Notes
flush()and rejectflush_key_field, because tracked mode turns serial awaited writes into concurrent tasks.Made with Cursor