SNOW-1447051: Unhandled resources after creating a Connection prevents process from terminating #846
Description
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
-
What version of NodeJS driver are you using?
1.10.1 -
What operating system and processor architecture are you using?
macOS Sonoma 14.4.1 -
What version of NodeJS are you using?
(node --version
andnpm --version
)
v20.10.0 -
What are the component versions in the environment (
npm list
)?
5.Server version:* E.g. 1.90.1
You may get the server version by running a query:
SELECT CURRENT_VERSION();
- What did you do?
Boilerplate app:
import { createConnection } from 'snowflake-sdk';
void (async () => {
const connection = createConnection({
authenticator: 'EXTERNALBROWSER',
account: '...',
username: '',
password: undefined,
role: '...',
warehouse: '...'
});
await connection.connectAsync((err) => {
if (err instanceof Error) {
throw err;
}
console.log('Successfully connected');
});
connection.destroy(() => console.log('Destroyed connection!'));
console.log('Done. Why am I hanging?');
})();
Running this code, you can see that the process hangs at the very end.
I'm also destroying the connection (although I shouldn't need to do it), but the result is still the same.
After a minute or so my process actually terminates, but this sometimes doesn't happen in Production. The hang may last for hours or forever (for all I know).
Using a tool like why-is-node-running shoes multiple handles referring the snowflake-sdk and its axios usage.
-
What did you expect to see?
I would expect the process to terminate.
-
Can you set logging to DEBUG and collect the logs?
CALL POST with timeout 90000: .../login-request?requestId=...
CALL POST with timeout 90000: .../delete=true?requestId=... -
What is your Snowflake account identifier, if any? (Optional)