@memberjunction/redis-provider 6.1.5 → 6.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77,12 +77,22 @@ export interface RedisProviderConfig {
77
77
  */
78
78
  defaultTTLSeconds?: number;
79
79
  /**
80
- * Maximum number of connection retry attempts before giving up.
81
- * Each retry uses exponential backoff (doubling delay up to 30 seconds).
80
+ * Caps reconnection attempts. Past the cap ioredis stops reconnecting for the life of the
81
+ * client, leaving the process cache-blind until it restarts.
82
82
  *
83
- * @default 10
83
+ * Omit it on a long-running process. Set it only for a short-lived script that should fail
84
+ * rather than wait out an outage.
85
+ *
86
+ * @default undefined — retry indefinitely, with each wait capped by {@link maxRetryDelayMs}
84
87
  */
85
88
  maxRetries?: number;
89
+ /**
90
+ * Ceiling on the wait between reconnection attempts, in milliseconds. The backoff doubles from
91
+ * 200ms up to this value and then holds there, so a long outage costs one attempt per ceiling.
92
+ *
93
+ * @default 30000
94
+ */
95
+ maxRetryDelayMs?: number;
86
96
  /**
87
97
  * Whether to log connection events (connect, disconnect, error) via
88
98
  * MemberJunction's `LogStatus` / `LogError` functions.
@@ -161,11 +171,46 @@ export declare class RedisLocalStorageProvider implements ILocalStorageProvider
161
171
  * other wrote. See {@link ILocalStorageProvider.SupportsCrossProcessPersistence}.
162
172
  */
163
173
  readonly SupportsCrossProcessPersistence = true;
174
+ /**
175
+ * Every server in a fleet shares one Redis keyspace.
176
+ * See {@link ILocalStorageProvider.SharedAcrossProcesses}.
177
+ */
178
+ readonly SharedAcrossProcesses = true;
164
179
  private _client;
165
180
  private _keyPrefix;
166
181
  private _defaultTTLSeconds;
167
182
  private _enableLogging;
168
183
  private _connected;
184
+ /** Ceiling on the reconnect delay. See {@link RedisProviderConfig.maxRetryDelayMs}. */
185
+ private _maxRetryDelayMs;
186
+ /**
187
+ * Whether this client has ever been connected. Distinguishes a startup that has not reached
188
+ * Redis yet, where queueing a command is useful, from a connection that was lost, where
189
+ * {@link shouldFailFast} applies.
190
+ */
191
+ private _hasEverConnected;
192
+ /**
193
+ * The highest shared epoch this process has seen, from its own mutations and from events
194
+ * received. {@link reconcileAfterReconnect} compares it against the value in Redis to decide
195
+ * whether anything was invalidated during a connection gap.
196
+ */
197
+ private _lastSeenEpoch;
198
+ /**
199
+ * Whether this process mutated shared state while disconnected, meaning other servers never
200
+ * received those invalidations. Set so {@link reconcileAfterReconnect} can bump the epoch on
201
+ * recovery and make them flush.
202
+ */
203
+ private _mutatedWhileDisconnected;
204
+ /** Guards against two overlapping reconciliations (client and subscriber both recover). */
205
+ private _reconciling;
206
+ /**
207
+ * Whether the loss of this connection has already been reported to consumers. Reports the loss
208
+ * once per outage — `close` fires on every failed reconnection attempt — and tells the `ready`
209
+ * handler that a recovery, rather than a first connection, is what it is seeing.
210
+ */
211
+ private _connectionLostEmitted;
212
+ /** As {@link _hasEverConnected}, for the subscriber connection. */
213
+ private _subscriberHasEverConnected;
169
214
  private _enablePubSub;
170
215
  private _subscriber;
171
216
  private _pubSubChannel;
@@ -216,12 +261,98 @@ export declare class RedisLocalStorageProvider implements ILocalStorageProvider
216
261
  * @internal
217
262
  */
218
263
  private retryStrategy;
264
+ /**
265
+ * Registers event handlers on the ioredis client for logging connection
266
+ * lifecycle events (connect, ready, close, error, reconnecting).
267
+ * @internal
268
+ */
269
+ private handleClientConnect;
270
+ /**
271
+ * On `ready` the client can serve commands again. A recovery is identified by
272
+ * {@link _connectionLostEmitted} rather than by inspecting `_connected`: ioredis emits `connect`
273
+ * before `ready`, so by this point `_connected` has already been set back to true and cannot
274
+ * distinguish a reconnect from a first connection.
275
+ *
276
+ * @internal
277
+ */
278
+ private handleClientReady;
279
+ /**
280
+ * `close` fires once per failed reconnection attempt, not only on the first drop, so the loss is
281
+ * announced through {@link noteConnectionLost} and reported once per outage.
282
+ *
283
+ * @internal
284
+ */
285
+ private handleClientClose;
219
286
  /**
220
287
  * Registers event handlers on the ioredis client for logging connection
221
288
  * lifecycle events (connect, ready, close, error, reconnecting).
222
289
  * @internal
223
290
  */
224
291
  private setupEventHandlers;
292
+ /**
293
+ * Whether a command should fail immediately instead of being handed to ioredis.
294
+ *
295
+ * True once a connection has been established and then lost. The clients set
296
+ * `maxRetriesPerRequest: null` and leave ioredis's offline queue enabled, so a command issued
297
+ * while disconnected is queued and its promise never settles — over a long outage that is
298
+ * unbounded memory and indefinitely hanging awaits. Callers instead get a miss from a read and
299
+ * a no-op from a write, both of which are correct and only slower.
300
+ *
301
+ * False before the first connection, so a brief queue can still warm the cache at startup.
302
+ * Nothing is stale at that point because nothing is cached.
303
+ *
304
+ * @internal
305
+ */
306
+ private get shouldFailFast();
307
+ /**
308
+ * Records the highest epoch this process has observed, from either direction — a mutation it
309
+ * published, or an event it received. Monotonic: a late-arriving lower value is ignored.
310
+ * @internal
311
+ */
312
+ private noteEpochSeen;
313
+ /**
314
+ * Records that shared state changed while this process could not tell anyone.
315
+ *
316
+ * Reconciliation has to be symmetric. The obvious direction is what this process MISSED, and the
317
+ * epoch comparison covers that. This is the other direction: writes this process made that its
318
+ * siblings never heard, which leave *them* confidently stale. On recovery the epoch is bumped so
319
+ * they flush too.
320
+ * @internal
321
+ */
322
+ private noteMutationWhileDisconnected;
323
+ /**
324
+ * Decides whether this process's caches are still trustworthy after a reconnect, and flushes
325
+ * them if not.
326
+ *
327
+ * ioredis resubscribes on its own, but pub/sub has no replay: invalidations published while this
328
+ * process was disconnected are gone, so the cache may hold entries other servers have already
329
+ * invalidated. One read of the shared epoch counter settles it:
330
+ *
331
+ * - unchanged — nothing was invalidated anywhere during the gap, so the cache is kept
332
+ * - advanced — something changed and this process cannot know what, so everything is dropped
333
+ * - this process mutated while disconnected — the epoch is bumped so siblings flush too, and
334
+ * the cache is dropped here as well
335
+ *
336
+ * An epoch that cannot be read is treated as advanced: without evidence of correctness, flush.
337
+ *
338
+ * @internal
339
+ */
340
+ private reconcileAfterReconnect;
341
+ /**
342
+ * Tells local consumers to drop everything they hold.
343
+ *
344
+ * Expressed as a `category_cleared` event per shared category rather than a new event type,
345
+ * because that action already means "assume nothing in this category is valid" and
346
+ * `LocalCacheManager.DispatchCacheChange` already fans it out to EVERY registered callback. A
347
+ * bespoke event would need every consumer taught about it; this one is understood today.
348
+ *
349
+ * `SourceServerId` is this process deliberately — the flush is local, and a sibling receiving it
350
+ * would filter it out as self-originated anyway since it is never published.
351
+ * @internal
352
+ */
353
+ private requestLocalFlush;
354
+ /** The Redis key holding the fleet-wide invalidation counter. @internal */
355
+ private buildEpochKey;
225
356
  /**
226
357
  * Builds the full Redis key from a category and key name.
227
358
  *
@@ -523,5 +654,94 @@ export declare class RedisLocalStorageProvider implements ILocalStorageProvider
523
654
  * Whether the pub/sub subscriber connection is currently active.
524
655
  */
525
656
  get IsSubscriberConnected(): boolean;
657
+ /**
658
+ * Registers a callback for the loss of the Redis connection.
659
+ *
660
+ * Fires on a transition only — not on the first connect, and not again while a reconnect is
661
+ * being retried. {@link IsConnected} reports the current state but not that it changed, so a
662
+ * consumer wanting to degrade or report health needs this rather than a poll.
663
+ *
664
+ * Use this in preference to reading the log: status-level logging is suppressed when
665
+ * `GetProductionStatus()` is true, so a deployed process says nothing when its cache client
666
+ * dies.
667
+ *
668
+ * @param callback - Invoked with a short human-readable reason for the loss
669
+ * @returns A function that removes this registration
670
+ *
671
+ * @example
672
+ * ```typescript
673
+ * const stop = provider.OnConnectionLost(reason => health.markCacheDown(reason));
674
+ * provider.OnConnectionRestored(() => health.markCacheUp());
675
+ * ```
676
+ */
677
+ OnConnectionLost(callback: (reason: string) => void): () => void;
678
+ /**
679
+ * Registers a callback for the Redis connection being restored after a loss. Not fired for the
680
+ * first connection.
681
+ *
682
+ * Cache correctness after the gap is handled by the provider itself; see
683
+ * {@link OnReconciliationRequired} for the signal that local state had to be dropped.
684
+ *
685
+ * @param callback - Invoked when the connection comes back
686
+ * @returns A function that removes this registration
687
+ */
688
+ OnConnectionRestored(callback: () => void): () => void;
689
+ /**
690
+ * Registers a callback for the provider having concluded, after a connection gap, that local
691
+ * cache state must be dropped.
692
+ *
693
+ * The standard categories are flushed by the provider itself via {@link OnCacheChanged}. Use
694
+ * this for state those categories do not describe — an in-process engine, a derived index, a
695
+ * memoized permission set — which would otherwise survive a reconnect while stale.
696
+ *
697
+ * Does not fire when nothing was invalidated anywhere during the gap.
698
+ *
699
+ * @param callback - Invoked when a flush is required
700
+ * @returns A function that removes this registration
701
+ */
702
+ OnReconciliationRequired(callback: () => void): () => void;
703
+ /**
704
+ * The highest fleet-wide epoch this process has observed. Exposed for diagnostics and for tests
705
+ * that need to assert what reconciliation decided; consumers should not need it.
706
+ */
707
+ get LastSeenEpoch(): number;
708
+ /**
709
+ * Reports a lost connection once per outage.
710
+ *
711
+ * Both routes into this are repeatable: `close` fires on every failed reconnection attempt, and an
712
+ * exhausted retry ceiling arrives separately after one. Consumers get a single notification, and
713
+ * the next `ready` clears the latch so the following outage reports again.
714
+ *
715
+ * @internal
716
+ */
717
+ private noteConnectionLost;
718
+ /**
719
+ * Raises the public lost-connection event and logs it.
720
+ *
721
+ * Uses the error channel, and is not gated behind `enableLogging`: status-level output is
722
+ * suppressed in production and that flag is routinely turned off, either of which would leave a
723
+ * dead cache client silent.
724
+ *
725
+ * @internal
726
+ */
727
+ private emitConnectionLost;
728
+ /**
729
+ * Raises the public restored-connection event and logs it, on the error channel for the same
730
+ * reason as the loss — otherwise the logs show an outage that never ends.
731
+ *
732
+ * @internal
733
+ */
734
+ private emitConnectionRestored;
735
+ /**
736
+ * Emits to consumer callbacks, containing each listener's errors so that neither the connection
737
+ * handling that triggered the event nor the other listeners are affected.
738
+ *
739
+ * Invokes listeners individually rather than through `EventEmitter.emit`, which calls them
740
+ * synchronously in turn: one throwing there would stop every listener after it from running at
741
+ * all.
742
+ *
743
+ * @internal
744
+ */
745
+ private safeEmit;
526
746
  }
527
747
  //# sourceMappingURL=RedisLocalStorageProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RedisLocalStorageProvider.d.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AGG;IACH,OAAO,CAAC,4BAA4B;IAgCpC;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IA2B3B;;;;;;;;;OASG;IACH,OAAO,CAAC,aAAa;IAyCrB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,cAAc,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI;IAQ/E;;OAEG;IACH,IAAW,qBAAqB,IAAI,OAAO,CAE1C;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACI,gBAAgB,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI;IAOvE;;;;;;;;;OASG;IACI,oBAAoB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAO7D;;;;;;;;;;;;OAYG;IACI,wBAAwB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAOjE;;;OAGG;IACH,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;IAQ1B;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;IAK1B;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAK9B;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAQ;CASnB"}
@@ -22,6 +22,14 @@ import { MJGlobal } from '@memberjunction/global';
22
22
  * @internal
23
23
  */
24
24
  const DEFAULT_CATEGORY = 'default';
25
+ /**
26
+ * The categories a reconnect-flush clears.
27
+ *
28
+ * Mirrors `CacheCategory` from `@memberjunction/core` as literals rather than importing it, so the
29
+ * provider takes no value dependency on that module and a category added there cannot change
30
+ * recovery behaviour here without an edit to this list.
31
+ */
32
+ const RECONCILED_CATEGORIES = ['RunViewCache', 'RunQueryCache', 'DatasetCache', 'Metadata', 'default'];
25
33
  /**
26
34
  * Redis-backed implementation of the MemberJunction {@link ILocalStorageProvider} interface.
27
35
  *
@@ -112,7 +120,40 @@ export class RedisLocalStorageProvider {
112
120
  * other wrote. See {@link ILocalStorageProvider.SupportsCrossProcessPersistence}.
113
121
  */
114
122
  this.SupportsCrossProcessPersistence = true;
123
+ /**
124
+ * Every server in a fleet shares one Redis keyspace.
125
+ * See {@link ILocalStorageProvider.SharedAcrossProcesses}.
126
+ */
127
+ this.SharedAcrossProcesses = true;
115
128
  this._connected = false;
129
+ /**
130
+ * Whether this client has ever been connected. Distinguishes a startup that has not reached
131
+ * Redis yet, where queueing a command is useful, from a connection that was lost, where
132
+ * {@link shouldFailFast} applies.
133
+ */
134
+ this._hasEverConnected = false;
135
+ /**
136
+ * The highest shared epoch this process has seen, from its own mutations and from events
137
+ * received. {@link reconcileAfterReconnect} compares it against the value in Redis to decide
138
+ * whether anything was invalidated during a connection gap.
139
+ */
140
+ this._lastSeenEpoch = 0;
141
+ /**
142
+ * Whether this process mutated shared state while disconnected, meaning other servers never
143
+ * received those invalidations. Set so {@link reconcileAfterReconnect} can bump the epoch on
144
+ * recovery and make them flush.
145
+ */
146
+ this._mutatedWhileDisconnected = false;
147
+ /** Guards against two overlapping reconciliations (client and subscriber both recover). */
148
+ this._reconciling = false;
149
+ /**
150
+ * Whether the loss of this connection has already been reported to consumers. Reports the loss
151
+ * once per outage — `close` fires on every failed reconnection attempt — and tells the `ready`
152
+ * handler that a recovery, rather than a first connection, is what it is seeing.
153
+ */
154
+ this._connectionLostEmitted = false;
155
+ /** As {@link _hasEverConnected}, for the subscriber connection. */
156
+ this._subscriberHasEverConnected = false;
116
157
  this._subscriber = null;
117
158
  this._eventEmitter = new EventEmitter();
118
159
  this._subscriberConnected = false;
@@ -120,9 +161,10 @@ export class RedisLocalStorageProvider {
120
161
  this._keyPrefix = config.keyPrefix ?? 'mj';
121
162
  this._defaultTTLSeconds = config.defaultTTLSeconds;
122
163
  this._enableLogging = config.enableLogging ?? true;
164
+ this._maxRetryDelayMs = config.maxRetryDelayMs ?? 30000;
123
165
  this._enablePubSub = config.enablePubSub ?? false;
124
166
  this._pubSubChannel = `${this._keyPrefix}:__pubsub__`;
125
- const maxRetries = config.maxRetries ?? 10;
167
+ const maxRetries = config.maxRetries; // undefined = retry forever, with a capped delay
126
168
  if (config.url) {
127
169
  this._client = new Redis(config.url, {
128
170
  maxRetriesPerRequest: null,
@@ -153,43 +195,78 @@ export class RedisLocalStorageProvider {
153
195
  * @internal
154
196
  */
155
197
  retryStrategy(times, maxRetries) {
156
- if (times > maxRetries) {
157
- if (this._enableLogging) {
158
- LogError(`Redis: max retries (${maxRetries}) exceeded, giving up`);
159
- }
198
+ // Returning null stops ioredis reconnecting for the life of the client, recoverable only by
199
+ // restarting the process, so only an explicit maxRetries gets that.
200
+ if (maxRetries !== undefined && times > maxRetries) {
201
+ // Error channel: status output is suppressed in production, and this is the one message
202
+ // that must reach a deployed log.
203
+ LogError(`Redis: max retries (${maxRetries}) exceeded after ${times} attempts — giving up permanently. ` +
204
+ `This process is now cache-blind until it restarts. Omit maxRetries to retry forever with a capped delay.`);
205
+ this.noteConnectionLost('retries exhausted');
160
206
  return null;
161
207
  }
162
- // Exponential backoff: 200ms, 400ms, 800ms, ... capped at 30s
163
- const delay = Math.min(times * 200, 30000);
208
+ // 200, 400, 800, 1600 … then held at maxRetryDelayMs.
209
+ const delay = Math.min(200 * Math.pow(2, times - 1), this._maxRetryDelayMs);
164
210
  if (this._enableLogging) {
165
- LogStatus(`Redis: reconnecting in ${delay}ms (attempt ${times}/${maxRetries})`);
211
+ const ceiling = maxRetries === undefined ? 'no limit' : `${maxRetries}`;
212
+ LogStatus(`Redis: reconnecting in ${delay}ms (attempt ${times}, limit ${ceiling})`);
166
213
  }
167
214
  return delay;
168
215
  }
216
+ /**
217
+ * Registers event handlers on the ioredis client for logging connection
218
+ * lifecycle events (connect, ready, close, error, reconnecting).
219
+ * @internal
220
+ */
221
+ handleClientConnect() {
222
+ this._connected = true;
223
+ if (this._enableLogging) {
224
+ LogStatus('Redis: connected');
225
+ }
226
+ }
227
+ /**
228
+ * On `ready` the client can serve commands again. A recovery is identified by
229
+ * {@link _connectionLostEmitted} rather than by inspecting `_connected`: ioredis emits `connect`
230
+ * before `ready`, so by this point `_connected` has already been set back to true and cannot
231
+ * distinguish a reconnect from a first connection.
232
+ *
233
+ * @internal
234
+ */
235
+ handleClientReady() {
236
+ this._connected = true;
237
+ this._hasEverConnected = true;
238
+ if (this._enableLogging) {
239
+ LogStatus('Redis: ready to accept commands');
240
+ }
241
+ if (this._connectionLostEmitted) {
242
+ this._connectionLostEmitted = false;
243
+ this.emitConnectionRestored();
244
+ }
245
+ }
246
+ /**
247
+ * `close` fires once per failed reconnection attempt, not only on the first drop, so the loss is
248
+ * announced through {@link noteConnectionLost} and reported once per outage.
249
+ *
250
+ * @internal
251
+ */
252
+ handleClientClose() {
253
+ this._connected = false;
254
+ if (this._enableLogging) {
255
+ LogStatus('Redis: connection closed');
256
+ }
257
+ if (this._hasEverConnected) {
258
+ this.noteConnectionLost('connection closed');
259
+ }
260
+ }
169
261
  /**
170
262
  * Registers event handlers on the ioredis client for logging connection
171
263
  * lifecycle events (connect, ready, close, error, reconnecting).
172
264
  * @internal
173
265
  */
174
266
  setupEventHandlers() {
175
- this._client.on('connect', () => {
176
- this._connected = true;
177
- if (this._enableLogging) {
178
- LogStatus('Redis: connected');
179
- }
180
- });
181
- this._client.on('ready', () => {
182
- this._connected = true;
183
- if (this._enableLogging) {
184
- LogStatus('Redis: ready to accept commands');
185
- }
186
- });
187
- this._client.on('close', () => {
188
- this._connected = false;
189
- if (this._enableLogging) {
190
- LogStatus('Redis: connection closed');
191
- }
192
- });
267
+ this._client.on('connect', () => this.handleClientConnect());
268
+ this._client.on('ready', () => this.handleClientReady());
269
+ this._client.on('close', () => this.handleClientClose());
193
270
  this._client.on('error', (err) => {
194
271
  if (this._enableLogging) {
195
272
  LogError(`Redis: ${err.message}`);
@@ -201,6 +278,141 @@ export class RedisLocalStorageProvider {
201
278
  }
202
279
  });
203
280
  }
281
+ /**
282
+ * Whether a command should fail immediately instead of being handed to ioredis.
283
+ *
284
+ * True once a connection has been established and then lost. The clients set
285
+ * `maxRetriesPerRequest: null` and leave ioredis's offline queue enabled, so a command issued
286
+ * while disconnected is queued and its promise never settles — over a long outage that is
287
+ * unbounded memory and indefinitely hanging awaits. Callers instead get a miss from a read and
288
+ * a no-op from a write, both of which are correct and only slower.
289
+ *
290
+ * False before the first connection, so a brief queue can still warm the cache at startup.
291
+ * Nothing is stale at that point because nothing is cached.
292
+ *
293
+ * @internal
294
+ */
295
+ get shouldFailFast() {
296
+ return this._hasEverConnected && !this._connected;
297
+ }
298
+ /**
299
+ * Records the highest epoch this process has observed, from either direction — a mutation it
300
+ * published, or an event it received. Monotonic: a late-arriving lower value is ignored.
301
+ * @internal
302
+ */
303
+ noteEpochSeen(epoch) {
304
+ if (typeof epoch === 'number' && epoch > this._lastSeenEpoch) {
305
+ this._lastSeenEpoch = epoch;
306
+ }
307
+ }
308
+ /**
309
+ * Records that shared state changed while this process could not tell anyone.
310
+ *
311
+ * Reconciliation has to be symmetric. The obvious direction is what this process MISSED, and the
312
+ * epoch comparison covers that. This is the other direction: writes this process made that its
313
+ * siblings never heard, which leave *them* confidently stale. On recovery the epoch is bumped so
314
+ * they flush too.
315
+ * @internal
316
+ */
317
+ noteMutationWhileDisconnected() {
318
+ this._mutatedWhileDisconnected = true;
319
+ }
320
+ /**
321
+ * Decides whether this process's caches are still trustworthy after a reconnect, and flushes
322
+ * them if not.
323
+ *
324
+ * ioredis resubscribes on its own, but pub/sub has no replay: invalidations published while this
325
+ * process was disconnected are gone, so the cache may hold entries other servers have already
326
+ * invalidated. One read of the shared epoch counter settles it:
327
+ *
328
+ * - unchanged — nothing was invalidated anywhere during the gap, so the cache is kept
329
+ * - advanced — something changed and this process cannot know what, so everything is dropped
330
+ * - this process mutated while disconnected — the epoch is bumped so siblings flush too, and
331
+ * the cache is dropped here as well
332
+ *
333
+ * An epoch that cannot be read is treated as advanced: without evidence of correctness, flush.
334
+ *
335
+ * @internal
336
+ */
337
+ async reconcileAfterReconnect() {
338
+ if (!this._enablePubSub || this._reconciling) {
339
+ return; // no cross-server invalidation to reconcile, or already in progress
340
+ }
341
+ this._reconciling = true;
342
+ try {
343
+ const dirty = this._mutatedWhileDisconnected;
344
+ this._mutatedWhileDisconnected = false;
345
+ let current;
346
+ if (dirty) {
347
+ // Make siblings flush: our writes never reached them.
348
+ current = await this._client.incr(this.buildEpochKey());
349
+ }
350
+ else {
351
+ const raw = await this._client.get(this.buildEpochKey());
352
+ current = raw === null ? 0 : Number(raw);
353
+ if (!Number.isFinite(current)) {
354
+ throw new Error(`epoch key held a non-numeric value: ${JSON.stringify(raw)}`);
355
+ }
356
+ }
357
+ // Any DIFFERENCE means flush, not only an advance. A lower value is not "no change": the
358
+ // counter is gone — cleared, evicted under maxmemory, or a different instance — and what
359
+ // happened before that is unknowable. Inequality also bounds the damage a peer can do by
360
+ // publishing an absurd epoch, since a later real value differs from it and flushes.
361
+ const suspect = dirty || current !== this._lastSeenEpoch;
362
+ if (!suspect) {
363
+ if (this._enableLogging) {
364
+ // Status, not the error channel: this is the routine outcome and says nothing
365
+ // happened. Only the decisions that DROP a cache are worth an operator's log.
366
+ LogStatus(`[Redis] reconciled after reconnect: epoch unchanged at ${current} — nothing was ` +
367
+ `invalidated while this process was away, so the local cache is kept`);
368
+ }
369
+ return;
370
+ }
371
+ LogError(`[Redis] reconciled after reconnect: epoch ${this._lastSeenEpoch} → ${current}` +
372
+ `${dirty ? ' (this process also mutated while disconnected, so siblings were told to flush)' : ''}` +
373
+ ` — dropping local cache`);
374
+ this._lastSeenEpoch = current;
375
+ this.requestLocalFlush();
376
+ }
377
+ catch (err) {
378
+ // Could not establish correctness; flush rather than trust.
379
+ LogError(`[Redis] reconciliation could not read the epoch (${err.message}) — flushing local cache to be safe`);
380
+ this.requestLocalFlush();
381
+ }
382
+ finally {
383
+ this._reconciling = false;
384
+ }
385
+ }
386
+ /**
387
+ * Tells local consumers to drop everything they hold.
388
+ *
389
+ * Expressed as a `category_cleared` event per shared category rather than a new event type,
390
+ * because that action already means "assume nothing in this category is valid" and
391
+ * `LocalCacheManager.DispatchCacheChange` already fans it out to EVERY registered callback. A
392
+ * bespoke event would need every consumer taught about it; this one is understood today.
393
+ *
394
+ * `SourceServerId` is this process deliberately — the flush is local, and a sibling receiving it
395
+ * would filter it out as self-originated anyway since it is never published.
396
+ * @internal
397
+ */
398
+ requestLocalFlush() {
399
+ for (const category of RECONCILED_CATEGORIES) {
400
+ const event = {
401
+ CacheKey: category,
402
+ Category: category,
403
+ Action: 'category_cleared',
404
+ Timestamp: Date.now(),
405
+ SourceServerId: MJGlobal.Instance.ProcessUUID,
406
+ Epoch: this._lastSeenEpoch,
407
+ };
408
+ this.safeEmit('cacheChanged', event);
409
+ }
410
+ this.safeEmit('reconciliationRequired');
411
+ }
412
+ /** The Redis key holding the fleet-wide invalidation counter. @internal */
413
+ buildEpochKey() {
414
+ return `${this._keyPrefix}:__epoch__`;
415
+ }
204
416
  /**
205
417
  * Builds the full Redis key from a category and key name.
206
418
  *
@@ -247,6 +459,9 @@ export class RedisLocalStorageProvider {
247
459
  * ```
248
460
  */
249
461
  async GetItem(key, category) {
462
+ if (this.shouldFailFast) {
463
+ return null; // a miss: the caller refetches from the source of truth
464
+ }
250
465
  try {
251
466
  const redisKey = this.buildKey(key, category ?? DEFAULT_CATEGORY);
252
467
  const raw = await this._client.get(redisKey);
@@ -287,6 +502,12 @@ export class RedisLocalStorageProvider {
287
502
  const out = new Map();
288
503
  if (keys.length === 0)
289
504
  return out;
505
+ if (this.shouldFailFast) {
506
+ // Every key a miss — same answer MGET would give for absent keys.
507
+ for (const k of keys)
508
+ out.set(k, null);
509
+ return out;
510
+ }
290
511
  try {
291
512
  const cat = category ?? DEFAULT_CATEGORY;
292
513
  const uniqueKeys = Array.from(new Set(keys));
@@ -354,6 +575,10 @@ export class RedisLocalStorageProvider {
354
575
  * ```
355
576
  */
356
577
  async SetItem(key, value, category, ttlSeconds) {
578
+ if (this.shouldFailFast) {
579
+ this.noteMutationWhileDisconnected();
580
+ return;
581
+ }
357
582
  try {
358
583
  const cat = category ?? DEFAULT_CATEGORY;
359
584
  const redisKey = this.buildKey(key, cat);
@@ -403,6 +628,10 @@ export class RedisLocalStorageProvider {
403
628
  * ```
404
629
  */
405
630
  async Remove(key, category) {
631
+ if (this.shouldFailFast) {
632
+ this.noteMutationWhileDisconnected();
633
+ return;
634
+ }
406
635
  try {
407
636
  const cat = category ?? DEFAULT_CATEGORY;
408
637
  const redisKey = this.buildKey(key, cat);
@@ -435,6 +664,10 @@ export class RedisLocalStorageProvider {
435
664
  * ```
436
665
  */
437
666
  async ClearCategory(category) {
667
+ if (this.shouldFailFast) {
668
+ this.noteMutationWhileDisconnected();
669
+ return;
670
+ }
438
671
  try {
439
672
  const cat = category || DEFAULT_CATEGORY;
440
673
  const categorySetKey = this.buildCategorySetKey(cat);
@@ -480,6 +713,9 @@ export class RedisLocalStorageProvider {
480
713
  * ```
481
714
  */
482
715
  async GetCategoryKeys(category) {
716
+ if (this.shouldFailFast) {
717
+ return []; // unknown rather than wrong: the caller treats it as nothing cached
718
+ }
483
719
  try {
484
720
  const cat = category || DEFAULT_CATEGORY;
485
721
  const categorySetKey = this.buildCategorySetKey(cat);
@@ -585,6 +821,9 @@ export class RedisLocalStorageProvider {
585
821
  * ```
586
822
  */
587
823
  async Exists(key, category) {
824
+ if (this.shouldFailFast) {
825
+ return false; // nothing is reachable, so nothing is cached as far as the caller is concerned
826
+ }
588
827
  try {
589
828
  const redisKey = this.buildKey(key, category ?? DEFAULT_CATEGORY);
590
829
  const result = await this._client.exists(redisKey);
@@ -614,6 +853,9 @@ export class RedisLocalStorageProvider {
614
853
  * ```
615
854
  */
616
855
  async GetTTL(key, category) {
856
+ if (this.shouldFailFast) {
857
+ return null; // unknown, which is what the catch below reports for an unreachable server
858
+ }
617
859
  try {
618
860
  const redisKey = this.buildKey(key, category ?? DEFAULT_CATEGORY);
619
861
  return await this._client.ttl(redisKey);
@@ -703,7 +945,7 @@ export class RedisLocalStorageProvider {
703
945
  * @internal
704
946
  */
705
947
  createSubscriberClient() {
706
- const maxRetries = this._config.maxRetries ?? 10;
948
+ const maxRetries = this._config.maxRetries; // undefined = retry forever, with a capped delay
707
949
  if (this._config.url) {
708
950
  return new Redis(this._config.url, {
709
951
  maxRetriesPerRequest: null,
@@ -728,13 +970,24 @@ export class RedisLocalStorageProvider {
728
970
  if (!this._subscriber)
729
971
  return;
730
972
  this._subscriber.on('connect', () => {
973
+ const wasDown = this._subscriberHasEverConnected && !this._subscriberConnected;
731
974
  this._subscriberConnected = true;
975
+ this._subscriberHasEverConnected = true;
732
976
  if (this._enableLogging) {
733
977
  LogStatus('Redis pub/sub subscriber: connected');
734
978
  }
979
+ // Reconciliation hangs off the subscriber because that is the connection which misses
980
+ // invalidations. ioredis resubscribes, but cannot replay what it missed.
981
+ if (wasDown) {
982
+ void this.reconcileAfterReconnect();
983
+ }
735
984
  });
736
985
  this._subscriber.on('close', () => {
986
+ const wasUp = this._subscriberConnected;
737
987
  this._subscriberConnected = false;
988
+ if (wasUp) {
989
+ LogError('[Redis] pub/sub subscriber disconnected — invalidations from other servers are not arriving');
990
+ }
738
991
  });
739
992
  this._subscriber.on('error', (err) => {
740
993
  if (this._enableLogging) {
@@ -750,6 +1003,9 @@ export class RedisLocalStorageProvider {
750
1003
  handlePubSubMessage(message) {
751
1004
  try {
752
1005
  const event = JSON.parse(message);
1006
+ // Before the self-filter below: any event reaching this subscriber shows how far the
1007
+ // shared counter has advanced, regardless of who published it.
1008
+ this.noteEpochSeen(event.Epoch);
753
1009
  // Skip events from this server instance
754
1010
  if (event.SourceServerId === MJGlobal.Instance.ProcessUUID) {
755
1011
  return;
@@ -789,13 +1045,22 @@ export class RedisLocalStorageProvider {
789
1045
  SourceServerId: MJGlobal.Instance.ProcessUUID,
790
1046
  Data: data,
791
1047
  };
792
- // Publish fire-and-forget — don't await, don't block the caller
793
- const payload = JSON.stringify(event);
794
- this._client.publish(this._pubSubChannel, payload).then(() => {
1048
+ // Bump the shared epoch, then publish carrying its new value. The counter lives here
1049
+ // because every mutation already routes through this method. INCR has to precede PUBLISH so
1050
+ // the payload can carry the result, which costs a second round trip — off the caller's path,
1051
+ // since this method is fire-and-forget.
1052
+ this._client.incr(this.buildEpochKey()).then((epoch) => {
1053
+ this.noteEpochSeen(epoch);
1054
+ event.Epoch = epoch;
1055
+ return this._client.publish(this._pubSubChannel, JSON.stringify(event));
1056
+ }).then(() => {
795
1057
  if (this._enableLogging) {
796
1058
  LogStatus(`Redis pub/sub: published ${action} event for key "${cacheKey}" on channel "${this._pubSubChannel}"`);
797
1059
  }
798
1060
  }).catch((err) => {
1061
+ // Nobody heard this change, so record it for reconcileAfterReconnect to bump the epoch
1062
+ // on recovery and make the other servers flush.
1063
+ this.noteMutationWhileDisconnected();
799
1064
  if (this._enableLogging) {
800
1065
  LogError(`Redis pub/sub publish failed: ${err.message}`);
801
1066
  }
@@ -835,5 +1100,132 @@ export class RedisLocalStorageProvider {
835
1100
  get IsSubscriberConnected() {
836
1101
  return this._subscriberConnected;
837
1102
  }
1103
+ /**
1104
+ * Registers a callback for the loss of the Redis connection.
1105
+ *
1106
+ * Fires on a transition only — not on the first connect, and not again while a reconnect is
1107
+ * being retried. {@link IsConnected} reports the current state but not that it changed, so a
1108
+ * consumer wanting to degrade or report health needs this rather than a poll.
1109
+ *
1110
+ * Use this in preference to reading the log: status-level logging is suppressed when
1111
+ * `GetProductionStatus()` is true, so a deployed process says nothing when its cache client
1112
+ * dies.
1113
+ *
1114
+ * @param callback - Invoked with a short human-readable reason for the loss
1115
+ * @returns A function that removes this registration
1116
+ *
1117
+ * @example
1118
+ * ```typescript
1119
+ * const stop = provider.OnConnectionLost(reason => health.markCacheDown(reason));
1120
+ * provider.OnConnectionRestored(() => health.markCacheUp());
1121
+ * ```
1122
+ */
1123
+ OnConnectionLost(callback) {
1124
+ this._eventEmitter.on('connectionLost', callback);
1125
+ return () => {
1126
+ this._eventEmitter.off('connectionLost', callback);
1127
+ };
1128
+ }
1129
+ /**
1130
+ * Registers a callback for the Redis connection being restored after a loss. Not fired for the
1131
+ * first connection.
1132
+ *
1133
+ * Cache correctness after the gap is handled by the provider itself; see
1134
+ * {@link OnReconciliationRequired} for the signal that local state had to be dropped.
1135
+ *
1136
+ * @param callback - Invoked when the connection comes back
1137
+ * @returns A function that removes this registration
1138
+ */
1139
+ OnConnectionRestored(callback) {
1140
+ this._eventEmitter.on('connectionRestored', callback);
1141
+ return () => {
1142
+ this._eventEmitter.off('connectionRestored', callback);
1143
+ };
1144
+ }
1145
+ /**
1146
+ * Registers a callback for the provider having concluded, after a connection gap, that local
1147
+ * cache state must be dropped.
1148
+ *
1149
+ * The standard categories are flushed by the provider itself via {@link OnCacheChanged}. Use
1150
+ * this for state those categories do not describe — an in-process engine, a derived index, a
1151
+ * memoized permission set — which would otherwise survive a reconnect while stale.
1152
+ *
1153
+ * Does not fire when nothing was invalidated anywhere during the gap.
1154
+ *
1155
+ * @param callback - Invoked when a flush is required
1156
+ * @returns A function that removes this registration
1157
+ */
1158
+ OnReconciliationRequired(callback) {
1159
+ this._eventEmitter.on('reconciliationRequired', callback);
1160
+ return () => {
1161
+ this._eventEmitter.off('reconciliationRequired', callback);
1162
+ };
1163
+ }
1164
+ /**
1165
+ * The highest fleet-wide epoch this process has observed. Exposed for diagnostics and for tests
1166
+ * that need to assert what reconciliation decided; consumers should not need it.
1167
+ */
1168
+ get LastSeenEpoch() {
1169
+ return this._lastSeenEpoch;
1170
+ }
1171
+ /**
1172
+ * Reports a lost connection once per outage.
1173
+ *
1174
+ * Both routes into this are repeatable: `close` fires on every failed reconnection attempt, and an
1175
+ * exhausted retry ceiling arrives separately after one. Consumers get a single notification, and
1176
+ * the next `ready` clears the latch so the following outage reports again.
1177
+ *
1178
+ * @internal
1179
+ */
1180
+ noteConnectionLost(reason) {
1181
+ if (this._connectionLostEmitted) {
1182
+ return;
1183
+ }
1184
+ this._connectionLostEmitted = true;
1185
+ this.emitConnectionLost(reason);
1186
+ }
1187
+ /**
1188
+ * Raises the public lost-connection event and logs it.
1189
+ *
1190
+ * Uses the error channel, and is not gated behind `enableLogging`: status-level output is
1191
+ * suppressed in production and that flag is routinely turned off, either of which would leave a
1192
+ * dead cache client silent.
1193
+ *
1194
+ * @internal
1195
+ */
1196
+ emitConnectionLost(reason) {
1197
+ LogError(`[Redis] connection lost (${reason}) — cache reads will miss and writes will no-op until it returns`);
1198
+ this.safeEmit('connectionLost', reason);
1199
+ }
1200
+ /**
1201
+ * Raises the public restored-connection event and logs it, on the error channel for the same
1202
+ * reason as the loss — otherwise the logs show an outage that never ends.
1203
+ *
1204
+ * @internal
1205
+ */
1206
+ emitConnectionRestored() {
1207
+ LogError('[Redis] connection restored');
1208
+ this.safeEmit('connectionRestored');
1209
+ }
1210
+ /**
1211
+ * Emits to consumer callbacks, containing each listener's errors so that neither the connection
1212
+ * handling that triggered the event nor the other listeners are affected.
1213
+ *
1214
+ * Invokes listeners individually rather than through `EventEmitter.emit`, which calls them
1215
+ * synchronously in turn: one throwing there would stop every listener after it from running at
1216
+ * all.
1217
+ *
1218
+ * @internal
1219
+ */
1220
+ safeEmit(event, ...args) {
1221
+ for (const listener of this._eventEmitter.rawListeners(event)) {
1222
+ try {
1223
+ listener(...args);
1224
+ }
1225
+ catch (err) {
1226
+ LogError(`[Redis] a ${event} listener threw: ${err.message}`);
1227
+ }
1228
+ }
1229
+ }
838
1230
  }
839
1231
  //# sourceMappingURL=RedisLocalStorageProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RedisLocalStorageProvider.js","sourceRoot":"","sources":["../src/RedisLocalStorageProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,MAAM,SAAS,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAyB,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,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EAAE,GAAG,IAAe;QAC9C,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5D,IAAI,CAAC;gBACA,QAAiD,CAAC,GAAG,IAAI,CAAC,CAAC;YAChE,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACX,QAAQ,CAAC,aAAa,KAAK,oBAAqB,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAC7E,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/redis-provider",
3
3
  "type": "module",
4
- "version": "6.1.5",
4
+ "version": "6.1.7",
5
5
  "description": "Redis-backed ILocalStorageProvider for MemberJunction — enables shared, persistent server-side caching via any Redis-compatible service (Azure Managed Redis, AWS ElastiCache, self-hosted, etc.)",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -11,8 +11,8 @@
11
11
  "author": "MemberJunction.com",
12
12
  "license": "BUSL-1.1",
13
13
  "dependencies": {
14
- "@memberjunction/core": "6.1.5",
15
- "@memberjunction/global": "6.1.5",
14
+ "@memberjunction/core": "6.1.7",
15
+ "@memberjunction/global": "6.1.7",
16
16
  "ioredis": "^5.6.1"
17
17
  },
18
18
  "devDependencies": {