You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(webapp): prefix mollifier env vars with TRIGGER_
All MOLLIFIER_* env vars renamed to TRIGGER_MOLLIFIER_*. The mollifier
primitive is generic — buffer + drainer + trip evaluator with no
trigger-specific assumptions at the redis-worker layer — but this
PR's webapp wiring is specifically the trigger-task mollifier, with
PII-sensitive payload handling and trigger-flow semantics. If we later
mollify another surface (deploys, schedules, etc.) those will want
their own env-var namespace; pre-prefixing now avoids a breaking
rename later.
Renames are mechanical: schema keys in env.server.ts, env.* references
across the v3/mollifier* modules, and a handful of doc-comment
mentions. The bootstrap fallback that has DRAINER_ENABLED default to
the ENABLED value is updated to read TRIGGER_MOLLIFIER_ENABLED from
process.env too. Code-side naming (classes, file names, the literal
word "mollifier") stays unchanged — the rename is env-var only.
Copy file name to clipboardExpand all lines: apps/webapp/app/v3/mollifier/mollifierDrainer.server.ts
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,8 @@ function initializeMollifierDrainer(): MollifierDrainer<BufferedTriggerPayload>
11
11
if(!buffer){
12
12
// Unreachable in normal config: getMollifierDrainer() gates on the
13
13
// same env flag as getMollifierBuffer(). If we hit this, fail loud
14
-
// — the operator has set MOLLIFIER_ENABLED=1 on a worker pod but
15
-
// the buffer can't initialise (e.g. MOLLIFIER_REDIS_HOST resolves
14
+
// — the operator has set TRIGGER_MOLLIFIER_ENABLED=1 on a worker pod but
15
+
// the buffer can't initialise (e.g. TRIGGER_MOLLIFIER_REDIS_HOST resolves
16
16
// to nothing). Crashing surfaces the misconfig immediately rather
17
17
// than silently leaving entries un-drained.
18
18
thrownewError("MollifierDrainer initialised without a buffer — env vars inconsistent");
@@ -24,7 +24,7 @@ function initializeMollifierDrainer(): MollifierDrainer<BufferedTriggerPayload>
24
24
// polling with no SIGTERM handler registered by the caller — exactly
25
25
// the failure mode the validation is supposed to prevent.
26
26
//
27
-
// The SIGTERM handler in worker.server.ts is sync fire-and-forget:
27
+
// The SIGTERM handler in mollifierDrainerWorker.server.ts is sync fire-and-forget:
28
28
// `drainer.stop({ timeoutMs })` returns a promise that keeps the event
29
29
// loop alive, but in cluster mode the primary runs its own
30
30
// GRACEFUL_SHUTDOWN_TIMEOUT and will call `process.exit(0)`
@@ -34,17 +34,17 @@ function initializeMollifierDrainer(): MollifierDrainer<BufferedTriggerPayload>
34
34
// its own teardown after the drainer settles.
35
35
constshutdownMarginMs=1_000;
36
36
if(
37
-
env.MOLLIFIER_DRAIN_SHUTDOWN_TIMEOUT_MS>=
37
+
env.TRIGGER_MOLLIFIER_DRAIN_SHUTDOWN_TIMEOUT_MS>=
38
38
env.GRACEFUL_SHUTDOWN_TIMEOUT-shutdownMarginMs
39
39
){
40
40
thrownewError(
41
-
`MOLLIFIER_DRAIN_SHUTDOWN_TIMEOUT_MS (${env.MOLLIFIER_DRAIN_SHUTDOWN_TIMEOUT_MS}) must be at least ${shutdownMarginMs}ms below GRACEFUL_SHUTDOWN_TIMEOUT (${env.GRACEFUL_SHUTDOWN_TIMEOUT}); otherwise the primary's hard exit shadows the drainer's deadline.`,
41
+
`TRIGGER_MOLLIFIER_DRAIN_SHUTDOWN_TIMEOUT_MS (${env.TRIGGER_MOLLIFIER_DRAIN_SHUTDOWN_TIMEOUT_MS}) must be at least ${shutdownMarginMs}ms below GRACEFUL_SHUTDOWN_TIMEOUT (${env.GRACEFUL_SHUTDOWN_TIMEOUT}); otherwise the primary's hard exit shadows the drainer's deadline.`,
0 commit comments