Do not emit error as it closes the internal DB's connection stream and the Pool needs to keep it open to reuse the the connection
This commit is contained in:
parent
95a092bd83
commit
57be7add68
@ -123,7 +123,7 @@ function handleCopyFrom (logger) {
|
|||||||
metrics.end(null, err);
|
metrics.end(null, err);
|
||||||
pgstream.emit('error', err);
|
pgstream.emit('error', err);
|
||||||
})
|
})
|
||||||
.on('close', () => pgstream.emit('error', new Error('Connection closed by client')))
|
.on('close', () => pgstream.emit('client-close', new Error('Connection closed by client')))
|
||||||
.pipe(throttle)
|
.pipe(throttle)
|
||||||
.pipe(decompress)
|
.pipe(decompress)
|
||||||
.on('data', data => {
|
.on('data', data => {
|
||||||
|
@ -56,7 +56,7 @@ module.exports = class StreamCopy {
|
|||||||
pgstream.on('warning', (msg) => this.logger.warn(msg));
|
pgstream.on('warning', (msg) => this.logger.warn(msg));
|
||||||
} else if (action === ACTION_FROM) {
|
} else if (action === ACTION_FROM) {
|
||||||
pgstream.on('finish', () => done());
|
pgstream.on('finish', () => done());
|
||||||
pgstream.on('error', err => client.connection.sendCopyFail(err.message));
|
pgstream.on('client-close', err => client.connection.sendCopyFail(err.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
pgstream.on('error', err => done(err));
|
pgstream.on('error', err => done(err));
|
||||||
|
Loading…
Reference in New Issue
Block a user