Commit 48cd891
committed
fix(relay): classify script quarantine by failure type
A single cooldown duration is too coarse for Apps Script deployment failures. Quota exhaustion and account-level authorization failures recover on a much longer cadence than transient Google edge or Apps Script backend failures. Treating both classes the same either probes exhausted deployments too aggressively or removes transiently unhealthy deployments for longer than necessary.
Relay failure handling now classifies script failures into two explicit quarantine classes. HTTP 429, HTTP 403, and response bodies that match quota or service-invocation limit text are treated as hard quota/account failures and quarantined for 24 hours. Google or Apps Script transient 5xx responses are treated as temporary relay failures and use the existing short cooldown window.
The transient class is deliberately narrow. Generic upstream 5xx bodies such as a destination-origin bad gateway do not quarantine a script ID by themselves; the body must look like a Google, Apps Script, GFE, backend, service-unavailable, temporary, or timeout failure. This avoids punishing healthy deployments for ordinary origin-side errors that Apps Script relayed correctly.
The same classifier is used across the direct relay path, h1 fallback path, tunnel single-operation path, and tunnel batch path. Quota-like errors returned inside the Apps Script JSON envelope still force the hard quarantine path even when the outer HTTP status is 200.
The English and Persian guides now describe auto-quarantine as two failure classes instead of a single ten-minute blacklist. Unit coverage verifies hard quota/account classification, transient Google-edge classification, ordinary upstream 5xx pass-through, and the quarantine durations for both classes.1 parent 6c839f7 commit 48cd891
3 files changed
Lines changed: 101 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
475 | 498 | | |
476 | 499 | | |
477 | 500 | | |
| |||
893 | 916 | | |
894 | 917 | | |
895 | 918 | | |
896 | | - | |
| 919 | + | |
897 | 920 | | |
898 | 921 | | |
899 | | - | |
900 | | - | |
| 922 | + | |
| 923 | + | |
901 | 924 | | |
902 | 925 | | |
903 | 926 | | |
| |||
2547 | 2570 | | |
2548 | 2571 | | |
2549 | 2572 | | |
2550 | | - | |
2551 | | - | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
2552 | 2579 | | |
2553 | 2580 | | |
2554 | 2581 | | |
| |||
2558 | 2585 | | |
2559 | 2586 | | |
2560 | 2587 | | |
2561 | | - | |
| 2588 | + | |
2562 | 2589 | | |
2563 | 2590 | | |
2564 | 2591 | | |
| |||
2656 | 2683 | | |
2657 | 2684 | | |
2658 | 2685 | | |
2659 | | - | |
2660 | | - | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
2661 | 2692 | | |
2662 | 2693 | | |
2663 | 2694 | | |
| |||
2669 | 2700 | | |
2670 | 2701 | | |
2671 | 2702 | | |
2672 | | - | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
2673 | 2708 | | |
2674 | 2709 | | |
2675 | 2710 | | |
| |||
3066 | 3101 | | |
3067 | 3102 | | |
3068 | 3103 | | |
3069 | | - | |
3070 | | - | |
| 3104 | + | |
| 3105 | + | |
3071 | 3106 | | |
3072 | 3107 | | |
3073 | 3108 | | |
| |||
3256 | 3291 | | |
3257 | 3292 | | |
3258 | 3293 | | |
3259 | | - | |
3260 | | - | |
| 3294 | + | |
| 3295 | + | |
3261 | 3296 | | |
3262 | 3297 | | |
3263 | 3298 | | |
| |||
4987 | 5022 | | |
4988 | 5023 | | |
4989 | 5024 | | |
4990 | | - | |
| 5025 | + | |
4991 | 5026 | | |
4992 | | - | |
| 5027 | + | |
| 5028 | + | |
| 5029 | + | |
| 5030 | + | |
4993 | 5031 | | |
4994 | | - | |
| 5032 | + | |
| 5033 | + | |
| 5034 | + | |
| 5035 | + | |
4995 | 5036 | | |
4996 | 5037 | | |
4997 | 5038 | | |
| |||
5008 | 5049 | | |
5009 | 5050 | | |
5010 | 5051 | | |
| 5052 | + | |
| 5053 | + | |
| 5054 | + | |
| 5055 | + | |
| 5056 | + | |
| 5057 | + | |
| 5058 | + | |
| 5059 | + | |
| 5060 | + | |
| 5061 | + | |
| 5062 | + | |
| 5063 | + | |
| 5064 | + | |
| 5065 | + | |
5011 | 5066 | | |
5012 | 5067 | | |
5013 | 5068 | | |
| |||
6447 | 6502 | | |
6448 | 6503 | | |
6449 | 6504 | | |
6450 | | - | |
6451 | | - | |
6452 | | - | |
6453 | | - | |
6454 | | - | |
| 6505 | + | |
| 6506 | + | |
| 6507 | + | |
| 6508 | + | |
| 6509 | + | |
| 6510 | + | |
| 6511 | + | |
| 6512 | + | |
| 6513 | + | |
| 6514 | + | |
| 6515 | + | |
| 6516 | + | |
| 6517 | + | |
| 6518 | + | |
| 6519 | + | |
6455 | 6520 | | |
6456 | 6521 | | |
6457 | 6522 | | |
6458 | 6523 | | |
6459 | 6524 | | |
6460 | 6525 | | |
6461 | 6526 | | |
| 6527 | + | |
| 6528 | + | |
| 6529 | + | |
| 6530 | + | |
| 6531 | + | |
| 6532 | + | |
| 6533 | + | |
| 6534 | + | |
| 6535 | + | |
| 6536 | + | |
| 6537 | + | |
| 6538 | + | |
6462 | 6539 | | |
6463 | 6540 | | |
6464 | 6541 | | |
| |||
0 commit comments