question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Pool connections closed by the server are never reinitialized

See original GitHub issue

Describe your system

  • odbc Package Version: latest
  • ODBC Driver: Plex
  • Database Name: Plex (Postgres based)
  • Node.js Version: 12.22
  • Node.js OS: Debian

Describe the bug When using pool connections, if the server just end the session, all connections at the freeConnections array will be in an invalid state. They are still marked as “connected” but they cannot be used. We have only 5 items at freeConnections, all with connected = true, but every usage attempt on any of them raises the error:

code: 2208
message: "[DataDirect][ODBC OpenAccess SDK driver][OpenAccess SDK Client]Internal network error, session aborted, connection closed"
state: "08S01"

Im describing this as a Pool error, because its “expected” from the pool to manage this, but its actually an error at the connection level, not detecting this.

Expected behavior Errored connections inside a pool should really close, leaving room for opening new connections in their place.

To Reproduce Steps to reproduce the behavior:

  1. Initialize a pool, run some queries
  2. Make connections enter in a Closed state (aborting/closing by the server-side)
  3. Run a new query

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

1reaction
kadlercommented, Aug 5, 2022

Looks like the pool does not check if the connection is still connected before handing it back. There is a “connected” attribute which retrieves the SQL_ATTR_CONNECTION_DEAD property which can be used to check this. This is how ODBC driver manager connection pooling checks for usable connections as documented here: https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/driver-manager-connection-pooling

0reactions
phpdavecommented, Sep 21, 2022

Can we re-open this issue still getting that error message

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I solve a connection pool problem between ASP.NET ...
In most cases connection pooling problems are related to connection leaks. Your application probably doesn't close its database connections correctly and ...
Read more >
issue with connection pool ? #7644 - prisma/prisma - GitHub
It looks like some connections are not re-used, as if they were waiting for the server or something. What can I do, application-side,...
Read more >
java.sql.SQLException: Io exception: Connection reset
- Set your steady-connection size to 0. With this, the pool will close out idle connections before their connections get reset. Note that...
Read more >
Connector/NET does not obey Connect Timeout - MySQL Bugs
3) When connections are released back to the pool, run "RESET CONNECTION STATE" ... Server problems never affect the pooling logic itself.
Read more >
4.7. The Mysteries of Connection Close - HTTP - O'Reilly
Servers shouldn't close a connection in the middle of a response unless client or network failure is suspected.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found