Commit 3fb2c05
fix: use thread_local Tokio runtime to avoid concurrency risks
Replace global OnceLock<Runtime> with thread_local! { OnceCell<Runtime> }.
Each OS thread now has its own Tokio current-thread runtime, preventing
contention when multiple Python threads call sync client methods concurrently.
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: MoonshotAI Kimi-K2.5 <support@moonshot.cn>1 parent e890ddb commit 3fb2c05
1 file changed
Lines changed: 15 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
15 | 8 | | |
16 | 9 | | |
17 | | - | |
| 10 | + | |
18 | 11 | | |
19 | 12 | | |
20 | 13 | | |
21 | 14 | | |
22 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
0 commit comments