Skip to content

Fix threaded header mutation errors - #1445

Merged
kurtmckee merged 2 commits into
mainfrom
fix-threaded-header-mutation-errors
Nov 10, 2026
Merged

kurtmckee merged 2 commits into
mainfrom
fix-threaded-header-mutation-errors

Conversation

@kurtmckee

Copy link
Copy Markdown
Member

Fixed

  • Fix a RuntimeError that can occur if a request is in-flight in one thread
    while another thread modifies transport headers.

@codspeed

codspeed Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Merging this PR will improve performance by 12.19%

1 warning

⚠️ 1 benchmark with a significant change ran on different hardware

Its base and head results were measured on machines with a different CPU, core count or memory, so the change might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 1 improved benchmark
✅ 17 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
⚡ test_deeply_nested_object_encoding[5w-1d] 173 µs 154.2 µs +12.19%

Tip

Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.


Comparing fix-threaded-header-mutation-errors (8b3bea2) with main (9f5191a)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (c7e83bb) during the generation of this report, so 9f5191a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Threaded use is not supported in the SDK,
but this eliminates one possible source of contention.
@kurtmckee
kurtmckee force-pushed the fix-threaded-header-mutation-errors branch from 23e61fc to 8b3bea2 Compare November 6, 2026 21:17

@sirosen sirosen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reminds me of that movie:
Jiro Dreams of frozendict

@kurtmckee
kurtmckee merged commit 19d9473 into main Nov 10, 2026
12 checks passed
@kurtmckee
kurtmckee deleted the fix-threaded-header-mutation-errors branch November 10, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants