Skip to content

feat(python): add QuicConfig transport configuration - #3991

Open
saie-ch wants to merge 11 commits into
apache:masterfrom
saie-ch:python-quic-config
Open

feat(python): add QuicConfig transport configuration#3991
saie-ch wants to merge 11 commits into
apache:masterfrom
saie-ch:python-quic-config

Conversation

@saie-ch

@saie-ch saie-ch commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR address?

Relates to #2835.

Rationale

Python's QUIC transport was only reachable through the untested from_connection_string() path, with no config object like TCP got in #3776.

What changed?

Added QuicConfig/QuicReconnectionConfig, accepted by IggyClient.quic(...), mirroring the TcpConfig pattern. Also fixed a bug where from_connection_string() failed on iggy+quic:// URLs because quinn::Endpoint::client needs an active Tokio runtime context.

Local Execution

  • All related tests passed
  • Pre-commit hooks ran

@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Aug 29, 2026
@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.62543% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.70%. Comparing base (2277864) to head (01a3700).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
foreign/python/src/config.rs 98.36% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             master    #3991    +/-   ##
==========================================
  Coverage     85.69%   85.70%            
  Complexity     1405     1405            
==========================================
  Files          1243     1243            
  Lines        188374   188646   +272     
  Branches     154469   154472     +3     
==========================================
+ Hits         161430   161674   +244     
- Misses        22876    22880     +4     
- Partials       4068     4092    +24     
Components Coverage Δ
Rust Core 86.61% <ø> (-0.02%) ⬇️
Java SDK 67.33% <ø> (ø)
C# SDK 77.08% <ø> (+0.10%) ⬆️
Python SDK 90.09% <98.62%> (+0.93%) ⬆️
PHP SDK 85.65% <ø> (ø)
Node SDK 96.23% <ø> (-0.03%) ⬇️
Go SDK 69.37% <ø> (-0.10%) ⬇️
Files with missing lines Coverage Δ
foreign/python/src/client.rs 99.86% <100.00%> (+<0.01%) ⬆️
foreign/python/src/duration.rs 97.77% <100.00%> (+1.77%) ⬆️
foreign/python/src/lib.rs 100.00% <100.00%> (ø)
foreign/python/src/config.rs 97.76% <98.36%> (+0.73%) ⬆️

... and 43 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread foreign/python/src/duration.rs Outdated
Comment thread foreign/python/src/config.rs
Comment thread foreign/python/src/config.rs Outdated
Comment thread foreign/python/src/config.rs Outdated
Comment thread foreign/python/tests/test_quic_config.py
@saie-ch
saie-ch force-pushed the python-quic-config branch from 52d0f86 to b56981f Compare August 31, 2026 05:47
@saie-ch

saie-ch commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @ethanlin01x Could you check now i've addressed the following

  • duration.rs: non-zero durations that round down to 0ms now raise ValueError instead of silently becoming the zero magic value.
  • Corrected the max_idle_timeout docstring to say it falls back to quinn's 30s default, not "no limit".
  • max_concurrent_bidi_streams/receive_window now validate against VarInt::MAX (2^62 - 1), not just u64::MAX.
  • initial_mtu now rejects anything below 1200 instead of accepting a value quinn silently clamps up.
  • Same here — added QuicReconnectionConfig(enabled=False) to both tests.

Comment thread foreign/python/README.md Outdated
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Aug 31, 2026

@slbotbm slbotbm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fold the config example code into existing examples as comments, and expose IggyClient (... | QuicConfig | ... ) instead of IggyClient.quic method.

numinnex
numinnex previously approved these changes Sep 3, 2026
Reject durations that round down to 0ms, fix the max_idle_timeout
docstring, validate max_concurrent_bidi_streams/receive_window against
VarInt::MAX, reject initial_mtu below quinn's 1200 floor, and disable
reconnection in the two auto-login tests that could otherwise hang.
Drop the IggyClient.quic() classmethod in favor of extending
IggyClient(...)'s existing TcpConfig union to also accept QuicConfig.
Trims the QUIC section from the main README and folds the standalone
quic/ example into a commented alternative in the getting-started
example, per review feedback.
@saie-ch

saie-ch commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

/ready
@hubcio @slbotbm Please take another look when you have a chance.

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Sep 5, 2026
saie-ch and others added 5 commits September 6, 2026 22:10
QuicConfig stores keep_alive_interval and max_idle_timeout as a
millisecond count, so a timedelta carrying a sub-millisecond
remainder read back as a different duration than the one passed
in. They were the only fields whose getter did not round-trip.
Reject the remainder, matching how an initial_mtu below quinn's
1200 floor is already refused rather than silently clamped. The
guard tests subsec_nanos so it does not rest on how pyo3 builds
the Duration.

Several QuicConfig tests asserted a bare RuntimeError or matched
only on a field name, so they could not tell which branch fired
and passed without reaching the behaviour under test. They now
pin the message. The QUIC connection-string case stops retrying
forever, so a missing listener fails instead of stalling.

Also corrects the client_address doc, which told callers to pin
the local address by setting it explicitly; the SDK compares it
against the default by string, so the default value passed
explicitly still gets the IPv6 bind swap.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WgJyB9b9cBN7z47zDNNTX
@hubcio
hubcio dismissed slbotbm’s stale review September 7, 2026 08:25

committer fixed all issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants