Commit b62ff61
committed
fix(flowcontrol): map pre-admission TTL/cancel to eviction statuses instead of 500
A TTL expiry or client disconnect that fires before an item is admitted
to a queue (buffered in the enqueue channel, blocked in SubmitOrBlock,
or racing managedQueue.Add) surfaces as QueueOutcomeRejectedOther
wrapping ErrTTLExpired or ErrContextCancelled, which
translateFlowControlOutcome mapped to 500 Internal. The same client
behavior an instant later (item queued) yields EvictedTTL or
EvictedContextCancelled and a 503 with a dropped-reason header.
translateFlowControlOutcome now branches on those sentinels in the
RejectedOther/EvictedOther case (after the shutdown check, which takes
precedence) and delegates to the corresponding eviction outcome's
mapping, so the pre-admission path always follows the post-admission
one, including any future changes to that mapping. The EvictedOther arm
gets the same branches as defensive symmetry; no current producer emits
it with these sentinels.
tryDistribution finalized a ManagedQueue lookup failure for a leased
flow (an internal invariant violation) as QueueOutcomeRejectedCapacity,
surfacing an internal error as 429 with the Saturated dropped-reason
header. It now finalizes as QueueOutcomeRejectedOther with a
descriptive error, which maps to 500 Internal without a saturation
header.
Fixes llm-d#2097
Part of llm-d#1187
Signed-off-by: Luke Van Drie <lukevandrie@google.com>1 parent 34478d1 commit b62ff61
4 files changed
Lines changed: 52 additions & 3 deletions
File tree
- pkg/epp
- flowcontrol/controller
- requestcontrol
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
359 | 362 | | |
360 | 363 | | |
361 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
| 420 | + | |
| 421 | + | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
248 | 258 | | |
249 | 259 | | |
250 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
367 | 403 | | |
368 | 404 | | |
369 | 405 | | |
| |||
0 commit comments