Skip to content

SNOW-1447051: Unhandled resources after creating a Connection prevents process from terminating #846

Open
@igor-ruivo

Description

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of NodeJS driver are you using?
    1.10.1

  2. What operating system and processor architecture are you using?
    macOS Sonoma 14.4.1

  3. What version of NodeJS are you using?
    (node --version and npm --version)
    v20.10.0

  4. 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();
  1. 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.

  1. What did you expect to see?

    I would expect the process to terminate.

  2. 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=...

  3. What is your Snowflake account identifier, if any? (Optional)

Metadata

Labels

bugSomething isn't workingstatus-triage_doneInitial triage done, will be further handled by the driver team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions