Skip to content
Pulse
HomeExploreProjectsOrganizationsLeaderboardDocs
Sign in
FeedExploreProjectsOrganizationsTechnologiesBLOCK RoomsKnowledgeLeaderboardBookmarksMy ProfileSettings

Status

Resolvedcritical
Comments
4
Participants
4
Events cited
0
Attachments
0

Resolved 14 days ago

Where

tidepool-cli
Node.jsPostgres

Who is here

  • JHJakir Hussian@jakirhussiandev · raised it
  • JHJakir Hussian@hussian007
  • Jjakir.dev.iwc007@jakir-dev-iwc007
  • Mmamtajalam123@mamtajalam123
FeedExplore
AlertsProfile
Pulse
FeedExploreProjectsOrganizationsTechnologiesBLOCK RoomsKnowledgeLeaderboardBookmarksMy ProfileSettings
BLOCK·Resolvedcritical

Connection pool exhausted during nightly import

tidepool-cli4 commentsraised by @jakirhussiandevassigned to @hussian007
The problem

Overview

The API starts returning 500s about ten minutes into the nightly import. Every request is waiting on a free connection.

code

Error: timeout exceeded when trying to connect

    at PoolClient.connect (pg-pool/index.js:45:11)

The pool is sized at 20; the importer opens a client per batch and never releases on error.

  • [ ] confirm the leak is on the error path
  • [ ] add a release in finally
Node.jsPostgres
Collaboration

Discussion (4)

Sign in to take part in this investigation.

  • Jakir Hussian@hussian007·15 days ago

    Confirmed — the importer never releases on the error path. @jakirhussiandev can you check whether the retry wrapper swallows it?

    ts
    
    try {
    
      await importBatch(client, rows);
    
    } catch (error) {
    
      // client.release() never runs
    
      throw error;
    
    }
    
    • Jakir Hussian@jakirhussiandev·15 days ago

      It does. Wrapping the batch in finally and raising the pool to 40 while we verify.

  • jakir.dev.iwc007@jakir-dev-iwc007·15 days ago

    Root cause

    The release is missing on the error path — see pool.release().

    It only leaks when a batch throws.
    1. size the pool at 40
    1. release in finally

    Raw HTML is not markup here: <script>alert(1)</script>

    Refused link: [click](javascript:alert(1)) — real link: the docs

  • mamtajalam123@mamtajalam123·15 days ago

    ddd

History

Timeline

  1. @jakirhussiandev raised this BLOCK.

    Jul 13, 2026, 2:49 PM UTC
  2. @jakirhussiandev assigned it to @hussian007.

    Jul 13, 2026, 2:49 PM UTC

@hussian007 commented: Confirmed — the importer never releases on the error path. @jakirhussiandev can you check whether the retry wrapper swallows it? code

Jul 13, 2026, 2:49 PM UTC
  • @hussian007 mentioned @jakirhussiandev.

    Jul 13, 2026, 2:49 PM UTC
  • @jakirhussiandev replied: It does. Wrapping the batch in finally and raising the pool to 40 while we verify.

    Jul 13, 2026, 2:49 PM UTC
  • @jakirhussiandev moved it from Open to Investigating

    Jul 13, 2026, 2:49 PM UTC
  • @jakir-dev-iwc007 commented: Root cause The release is missing on the error path — see pool.release(). It only leaks when a batch throws. 1. size the pool at 40 2. rele…

    Jul 13, 2026, 2:55 PM UTC
  • @mamtajalam123 commented: ddd

    Jul 13, 2026, 2:57 PM UTC
  • @hussian007 moved it from Investigating to Resolved

    Jul 13, 2026, 8:02 PM UTC
  • @hussian007 moved it from Resolved to Investigating

    Jul 13, 2026, 8:02 PM UTC
  • @hussian007 moved it from Investigating to Resolved

    Jul 13, 2026, 8:02 PM UTC