Skip to content

Commit 6d8b79c

Browse files
committed
fix(pii): name the exact retryable statuses in the retry budget comment
1 parent 6301253 commit 6d8b79c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎apps/sim/lib/guardrails/mask-client.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ const logger = createLogger('PiiMaskClient')
2626
const CHUNK_CONCURRENCY = env.PII_MASK_CHUNK_CONCURRENCY ?? 64
2727

2828
/**
29-
* Attempts per chunk for transient failures (network errors, timeouts, 408/429/5xx),
30-
* the 3-attempt default of the AWS SDK standard retry mode and the OpenAI and
31-
* Anthropic SDKs. A large payload fans out into many chunk requests, so one blip (a
29+
* Attempts per chunk for transient failures (network errors, timeouts, and the
30+
* statuses in {@link RETRYABLE_STATUSES}), the 3-attempt default of the AWS SDK
31+
* standard retry mode and the OpenAI and Anthropic SDKs. A large payload fans out into many chunk requests, so one blip (a
3232
* dropped connection, a Presidio worker restart, a request queued behind a busy
3333
* fleet) must not fail the whole redaction. The budget stays small because every
3434
* retry re-runs the chunk's full NER pass, so a chunk that fails on its own input (a
3535
* 500 from a recognizer) only repeats that work before reaching the fail-safe.
3636
* Without a `Retry-After`, the jittered backoff spans about 1.5s; an outage
3737
* (502/503/504) that outlasts it falls to the caller's fail-safe, which with
3838
* {@link MaskPIIBatchOptions.failedChunkPlaceholder} also scrubs chunks not yet sent.
39-
* Other 4xx and shape mismatches throw immediately.
39+
* Any other status and shape mismatches throw immediately.
4040
*/
4141
const MAX_CHUNK_ATTEMPTS = 3
4242

0 commit comments

Comments
 (0)