// Separate from AUTH_STORE_LOCK_OPTIONS for independent tuning: this lock // serializes the cross-agent OAuth refresh (see issue #26322), whereas // AUTH_STORE_LOCK_OPTIONS guards per-store file writes. Keeping them // distinct lets us widen the refresh lock's timeout/retry budget without // affecting the hot-path auth-store writers. // // Invariant: OAUTH_REFRESH_CALL_TIMEOUT_MS < OAUTH_REFRESH_LOCK_OPTIONS.stale // so a legitimate refresh's critical section always finishes well before // peers would treat the lock as reclaimable. Violating this invariant re- // introduces the `refresh_token_reused` race the lock is meant to prevent. // // Retry budget note: keep the MINIMUM cumulative retry window comfortably // above OAUTH_REFRESH_CALL_TIMEOUT_MS so waiters do not give up while a // legitimate slow refresh is still within its allowed runtime budget.
export const OAUTH_REFRESH_LOCK_OPTIONS = {
retries: {
retries: 20,
factor: 2,
minTimeout: 100,
maxTimeout: 10_000,
randomize: true,
},
stale: 180_000,
} as const;
// Hard upper bound on a single OAuth refresh call (plugin hook + HTTP // token-exchange). Any refresh that runs longer than this is aborted and // surfaced as a refresh failure. Keep strictly below // OAUTH_REFRESH_LOCK_OPTIONS.stale so the lock is never treated as stale // by a waiter while the owner is still doing legitimate work.
export const OAUTH_REFRESH_CALL_TIMEOUT_MS = 120_000;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.