Skip to content

Commit f898672

Browse files
authoredAug 30, 2021
fix: Fix undefined property warning in executeAutoPipeline (#1425)
Seen in an uncaughtException handler. ``` err_type=uncaughtException, exiting cause=TypeError: Cannot read property 'Symbol(callbacks)' of undefined at Immediate.executeAutoPipeline (.../node_modules/ioredis/built/autoPipelining.js:34:31) at Shim.applySegment (.../node_modules/newrelic/lib/shim/shim.js:1430:20) at Immediate.wrapper (.../node_modules/newrelic/lib/shim/shim.js:2097:17) at processImmediate (internal/timers.js:463:21) ``` A similar error was among the errors reported in #1248 I suspect the process.exec might call the callback synchronously in the same tick in some cases, immediately deleting the autopipeline from running pipelines?
1 parent cba83cb commit f898672

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎lib/autoPipelining.ts

+10
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ function executeAutoPipeline(client, slotKey: string) {
2727
if (client._runningAutoPipelines.has(slotKey)) {
2828
return;
2929
}
30+
if (!client._autoPipelines.has(slotKey)) {
31+
/*
32+
Rare edge case. Somehow, something has deleted this running autopipeline in an immediate
33+
call to executeAutoPipeline.
34+
35+
Maybe the callback in the pipeline.exec is sometimes called in the same tick,
36+
e.g. if redis is disconnected?
37+
*/
38+
return;
39+
}
3040

3141
client._runningAutoPipelines.add(slotKey);
3242

0 commit comments

Comments
 (0)
Please sign in to comment.