Skip to content

Commit 5da1ccb

Browse files
author
Adam Fanello
committed
Issue #69 - Retry on EPIPE error
Attempts to reuse a connection with MariaDB 10.3.8 sometimes results in an EPIPE error. Retry with a new connection when this happens, just like other dropped-connection errors.
1 parent 7909f3f commit 5da1ccb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ module.exports = (params) => {
191191
client.destroy() // destroy connection on timeout
192192
resetClient() // reset the client
193193
reject(err) // reject the promise with the error
194-
} else if (err && (/^PROTOCOL_ENQUEUE_AFTER_/.test(err.code) || err.code === 'PROTOCOL_CONNECTION_LOST')) {
194+
} else if (err && (/^PROTOCOL_ENQUEUE_AFTER_/.test(err.code) || err.code === 'PROTOCOL_CONNECTION_LOST' || err.code === 'EPIPE')) {
195195
resetClient() // reset the client
196196
return resolve(query(...args)) // attempt the query again
197197
} else if (err) {

0 commit comments

Comments
 (0)