Repository navigation
fix(thrift): warn and fall back to 10 for invalid max_download_threads - #1090
Open
atharva18-hue wants to merge 1 commit into
Open
atharva18-hue wants to merge 1 commit into
atharva18-hue wants to merge 1 commit into
Conversation
A non-positive (or non-integer) max_download_threads was forwarded unvalidated to ThreadPoolExecutor(max_workers=...), so the first CloudFetch-sized query raised ValueError instead of running. Validate the knob in ThriftDatabricksClient.__init__: warn and use the default of 10, mirroring the kernel backend validation shape (which raises) but keeping the session open, as the conformance expectation requires. Fixes databricks#903 (CLOUDFETCH-019). Signed-off-by: Atharva Chavhan <atharvachavhan18@gmail.com>
This branch has not been deployed
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.
Fixes #903 (CLOUDFETCH-019).
Problem
The Thrift backend forwarded a non-positive
max_download_threadsstraight toThreadPoolExecutor(max_workers=...), so a client-side tuning typo (e.g.max_download_threads=0) made the first CloudFetch-sized query raiseValueError: max_workers must be greater than 0instead of running.Fix
Validate the knob in
ThriftDatabricksClient.__init__via a new_coerce_max_download_threads()helper: an invalid value (bool, non-int, or <= 0) logs a warning and falls back to the default of 10, so the session opens and queries run. The validation shape mirrors the kernel backend, which raisesValueErrorfor the same knob — Thrift warns and defaults instead, because the conformance expectation is that an invalid client-side knob value must not fail session open.Tests
tests/unit/test_thrift_backend.py: invalid values (0, -1, None, "4", 1.5, True) coerce to 10 with a warning; valid values pass through; client construction with 0 / -3 yieldsmax_download_threads == 10.test_thrift_backend.py + test_download_manager.py + test_retry.py: 127 passed, 82 skipped (pyarrow-gated tests skipped locally — the sandbox NumPy is 1.26.4 and pyarrow needs >= 2.0; CI covers them).Notes
ThreadPoolExecutor, so it is out of scope here.Signed-off-by: Atharva Chavhan atharvachavhan18@gmail.com