Skip to content
This repository has been archived by the owner on Mar 10, 2023. It is now read-only.

Pool recovery #9

Open
elsbrock opened this issue Sep 11, 2020 · 1 comment
Open

Pool recovery #9

elsbrock opened this issue Sep 11, 2020 · 1 comment

Comments

@elsbrock
Copy link

elsbrock commented Sep 11, 2020

We recently had what seems like a connection hiccup to our HANA database (connection reset). While the database was reachable shortly after, it seems like all connections in the pool failed and did not recover, leading to a downtime.

Can you comment on the intended behavior? What can we do to make sure the pool automatically recovers from such failures and connections are correctly invalidated and recreated? I was unable to find information on this topic.

We are using hdb-pool in the context of typeorm.

Thanks!

@ckyycc
Copy link
Owner

ckyycc commented Sep 15, 2020

Before delivering a connection, the pool will check the status of the connection. The pool will deliver the connection only when the state of the connection is 'connected' (https://help.sap.com/viewer/0eec0d68141541d1b07893a39944924e/2.0.04/en-US/aeb50c109d19452ba6515a1fab515e5c.html). If the status is not 'connected', the related connection will be destroyed and moved out from the pool automatically (that specific request will be failed with CONNECTION_VALIDATION_ERROR).

According to your description, the status of the connection was 'connected' but actually the connection was not working (The pool will not know this).

So, I think:

  1. it's better to have a reproduce scenario.
  2. check with SAP about the connection.state( ), why connection.state() returns 'connected' but the connection actually doesn't work.
  3. for the pool, you can manually trigger pool.destroy(connection) to destroy a specific connection or pool.clear() to clear the entire pool.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants