You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the log-process-errors package to log errors throughout my application and Clickhouse queries keep triggering the "multiple resolves" logger. This is because, in cases of a successful query, the promise is getting resolved and then rejected.
The HTTP Adapter code seems to remove listeners asynchronously, causing the steps to be taken in the following order:
onAbort => rejects the promise, but should be ignored, and would be if the listeners were removed synchronously
removeRequestListeners
Taking note of the following comment in the code, I see why this was done:
// Adapter uses 'close' event to clean up listeners after the successful response.
// It's necessary in order to handle 'abort' and 'timeout' events while response is streamed.
// setImmediate is a workaround. If a request cancelled before sent, the 'abort' happens after 'close'.
// Which contradicts the docs https://nodejs.org/docs/latest-v14.x/api/http.html#http_http_request_url_options_callback
However, even though multiple resolves is a minor issue, it is still noisy and poor hygiene.
The text was updated successfully, but these errors were encountered:
Node version: 16.17.1
I use the
log-process-errors
package to log errors throughout my application and Clickhouse queries keep triggering the "multiple resolves" logger. This is because, in cases of a successful query, the promise is getting resolved and then rejected.The HTTP Adapter code seems to remove listeners asynchronously, causing the steps to be taken in the following order:
setImmediate(removeRequestListeners)
Taking note of the following comment in the code, I see why this was done:
However, even though multiple resolves is a minor issue, it is still noisy and poor hygiene.
The text was updated successfully, but these errors were encountered: