CartoDB / CartoDB-SQL-API

CartoDB SQL API
BSD 3-Clause "New" or "Revised" License
63 stars 65 forks source link

Do not emit error when the client closes the connection in `copyto` #658

Open dgaubert opened 4 years ago

dgaubert commented 4 years ago
[2020-05-20 13:06:33.739] [ERROR] console - Error: Connection closed by client
    at ServerResponse.<anonymous> (/home/ubuntu/www/node-sql-api/releases/20200520073947/lib/api/sql/copy-controller.js:95:59)
    at ServerResponse.emit (events.js:310:20)
    at emitCloseNT (_http_server.js:711:8)
    at processTicksAndRejections (internal/process/task_queues.js:83:21)

As the behavior of event end has changed in Node.js 12 it's logging this error. Luckily it isn't breaking anything as the copyto is working fine, just the connection to the database is being closed after the query ends then the pool creates a new one.