Commit ac11a11
committed
fix: add AbortController timeout to fetchApi to prevent connection pool exhaustion
Without a timeout, a hung fetch occupies one of the browser's ~6 HTTP/1.1
connection slots indefinitely after long sessions, silently blocking all
subsequent requests to the same host (including POST /prompt).
- 60 s AbortController timeout on every fetchApi() call
- Caller-supplied signals are preserved via AbortSignal.any()
- Emits a Sentry breadcrumb and Mixpanel FETCH_TIMEOUT event before aborting
so we can confirm the hypothesis in production and verify the fix
Fixes #143891 parent c814b8e commit ac11a11
3 files changed
Lines changed: 55 additions & 3 deletions
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
425 | 430 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
895 | 895 | | |
896 | 896 | | |
897 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
898 | 905 | | |
899 | 906 | | |
900 | 907 | | |
| |||
1022 | 1029 | | |
1023 | 1030 | | |
1024 | 1031 | | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1025 | 1035 | | |
1026 | 1036 | | |
1027 | 1037 | | |
| |||
1166 | 1176 | | |
1167 | 1177 | | |
1168 | 1178 | | |
1169 | | - | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
1170 | 1183 | | |
1171 | 1184 | | |
1172 | 1185 | | |
| |||
1257 | 1270 | | |
1258 | 1271 | | |
1259 | 1272 | | |
| 1273 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
498 | 500 | | |
499 | 501 | | |
500 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
501 | 534 | | |
502 | 535 | | |
503 | | - | |
| 536 | + | |
504 | 537 | | |
505 | | - | |
| 538 | + | |
506 | 539 | | |
507 | 540 | | |
508 | 541 | | |
| |||
0 commit comments