Commit 03f0d26
committed
fix(flowcontrol): map pre-admission TTL/cancel to eviction statuses instead of 500
A TTL expiry or client disconnect before an item reaches a queue
(buffered in the enqueue channel, blocked in SubmitOrBlock, or racing
managedQueue.Add) finalizes as QueueOutcomeRejectedOther, which the
translator mapped to 500. Once the item is queued, the same event maps
to 503 with a dropped-reason header. These pre-admission windows are
widest under overload, so a saturation stall with TTL expiries showed
up as a spike of 500s that was really backpressure.
The translator now recognizes ErrTTLExpired and ErrContextCancelled in
the RejectedOther/EvictedOther arm (after the shutdown check, which
keeps precedence) and delegates to the matching eviction mapping, so
the two paths cannot drift apart. The same branches cover EvictedOther
for symmetry; nothing currently emits it with these sentinels.
Separately, tryDistribution finalized a ManagedQueue lookup failure for
a leased flow as QueueOutcomeRejectedCapacity, reporting an internal
invariant violation as 429 with the Saturated header. It now finalizes
as RejectedOther: a 500 with no saturation header. This also keeps the
RejectedCapacity metric label to genuine capacity rejections. The
registry error is flattened with %v because wrapping it would let
ErrPriorityBandNotFound flow back through the connection closure and
trip the priority-0 fallback in withConnectionWithFallback.
Fixes #2097
Part of #1187
Signed-off-by: Luke Van Drie <lukevandrie@google.com>1 parent 34478d1 commit 03f0d26
4 files changed
Lines changed: 68 additions & 7 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 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
359 | 365 | | |
360 | 366 | | |
361 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
401 | 404 | | |
402 | 405 | | |
403 | | - | |
| 406 | + | |
404 | 407 | | |
405 | 408 | | |
| 409 | + | |
406 | 410 | | |
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
| 414 | + | |
410 | 415 | | |
411 | 416 | | |
412 | 417 | | |
| |||
417 | 422 | | |
418 | 423 | | |
419 | 424 | | |
420 | | - | |
421 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
422 | 431 | | |
423 | 432 | | |
424 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
| 246 | + | |
246 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
247 | 258 | | |
248 | | - | |
249 | 259 | | |
250 | 260 | | |
251 | 261 | | |
| |||
| 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