W-23459262 fix(python-binding): bound streaming output queue and stop leaking worker threads#122
Merged
Conversation
…rker threads Extracted from the native-bindings work in PR #119 so the fixes to the pre-existing Python binding can be reviewed and merged independently of the new C/Go/Rust bindings. - Bound the streaming/transform output queue (maxsize=512) with a timed put(timeout=30) so a slow or abandoned consumer exerts backpressure onto the native producer instead of growing an unbounded queue that can OOM. On timeout the write callback returns -1 to abort the native side. - Make the worker thread non-daemon and join with a timeout, raising DataWeaveError on timeout, so worker threads are not silently leaked when the interpreter continues. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
svacas
approved these changes
Jul 15, 2026
martincousido
approved these changes
Jul 15, 2026
mlischetti
added a commit
that referenced
this pull request
Jul 16, 2026
The native-lib/node/repro and native-lib/python/repro folders are regression guards for the pre-existing Node and Python bindings, covering fixes that already merged to master independently (PR #121 read-callback exception, PR #122 streaming queue backpressure). They are unrelated to the new C/Go/Rust bindings this branch introduces, are not wired into any build/CI, and were intentionally excluded when the Node/Python docs were extracted (PR #126). Remove them so they do not re-land on master with this feature. The C and Go repro folders remain — they exercise the new bindings added here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mlischetti
added a commit
that referenced
this pull request
Jul 16, 2026
The native-lib/node/repro and native-lib/python/repro folders are regression guards for the pre-existing Node and Python bindings, covering fixes that already merged to master independently (PR #121 read-callback exception, PR #122 streaming queue backpressure). They are unrelated to the new C/Go/Rust bindings this branch introduces, are not wired into any build/CI, and were intentionally excluded when the Node/Python docs were extracted (PR #126). Remove them so they do not re-land on master with this feature. The C and Go repro folders remain — they exercise the new bindings added here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Extracted from #119 so the fixes to the pre-existing Python binding can be reviewed and merged independently of the new C/Go/Rust bindings.
Changes
native-lib/python/src/dataweave/__init__.pymaxsize=512) with a timedput(timeout=30). A slow or abandoned consumer now exerts backpressure onto the native producer instead of growing anunbounded queue. On timeout the write callback returns
-1to abort the native side.join(timeout=30), raisingDataWeaveErroron timeout, so worker threads are not silently orphaned.Notes
master; touches only the pre-existing Python binding — no dependency on the new bindings in Native-bindings #119.