Skip to content

A reserved/released ReservedSql prevents the main Sql from ending #925

@jamesgpearce

Description

@jamesgpearce

Awesome library! Thanks so far. I have a small issue though... this works fine:

const sql1 = postgres(process.env.DATABASE_URL);
await sql1.end();

But this hangs indefinitely:

const sql1 = postgres(process.env.DATABASE_URL);

  const sql2 = await sql1.reserve();
  sql2.release();

await sql1.end(); // never completes

Once I have reserved/released a ReservedSql connection, the only way I can end the whole thing cleanly is to add a timeout with await sql1.end({timeout: 0.1});.

By the way, I notice that the .release method doesn't seem asynchronous, even though the example in the readme has an await. That doesn't fix this issue though.

Is this expected? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions