-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with getConnection() if server doesn't respond to validationSQL #28
Comments
For Oracle applications, you can set timeouts on connection establishment and message timeouts in the Oracle Net layer, see https://oracle.github.io/node-oracledb/doc/api.html#connectionha node-oracledb itself has a call timeout but you need to be using 18c Oracle client libraries. From the sound of it, you have some deeper issue that you need to resolve. |
PS Since you have |
@Tommy-LSA I agree with @cjbj |
I actually use following setup
I allready hat a talk with DBA who said that on serverside no limitatiton or timeout is configured. Firewall timeout are also not set, confirmed by network team. The whole application works like a charm as long enough queries go thru. If there is a longer time with no queries (3hrs or so) the connections are in this strange state where queries are not responded. An actual workaround for now is to set the poolTimeout to 60 and run an intervalled keepalive query every 5 mins. This pool access let the pool close all open connections which have reached the pool timeout. Our goal is to leave the connections open as long as possible to avoid the overhead while opening connections. That's why I used poolTimeout = 0 which shouldn't be a problem normally with your library. I have no clue why the connections seem to be open but no respond on a query. A timeout for getConnection() on my end won't work because the connection instance, tried by your code, is unknown to me in this moment. So I cannot release it to repair it. I only could react on a timeout by recreating the complete pool. Edit: |
I can't comment on simple-oracledb, which I don't use. @sagiegurari will have to chime in on its specifics. I will use pure node-oracledb terminology and options. Are you releasing connections to the pool and then waiting 3 hours? Or have you done a It still sounds like the network on the machine(s) running node-oracledb needs configuring. What is the operating system? To give some brute-force suggestions, you could try Can you explain more about what you meant by:
I don't understand. Or is this intended for @sagiegurari to add to simple-oracledb? |
Yes, all connections are released directly after response is returned. Also if an error occur the a release is executed. I have observed that over a while and see always (with poolTimeout = 60)
and with poolTimeout=0
where the single open connection in first situation is resulting from my actual keepalive intervall query. The code is used while developing under windows and for test and production in a docker swarm under linux. The behavior is the same. The mentioned sentence was indeed for @sagiegurari . As long getConnection() doesn't return I have no connection which I could release. So, building a timeout around getConnection() makes no sense from my code. I only have access to the pool instance and could rebuilt the pool itselve which is very timeconsuming on min=max=20 connections. |
In the initial post, you said that
|
The getConnection() in simple-oracledb executes a SELECT 1 FROM DUAL as test. That's why getConnection() from simple-oracledb doesn't return. Anyway, because the poolTimeout set to 30 minutes combined with a "keepalive" query every 5 minutes runs stable since a few days. 30 minutes open time for a connection is enough to reduce reconnects to a minimum and doesn't loose the connection thru to long open time. So I have removed the whole simple-oracledb from my solution as it doesn't fix anything for me in actual release. |
@Tommy-LSA Let us know if you want to continue with this; it would be good to identify the underlying cause so we can see where improvements can be made to node-oracledb. |
Hi,
I try to use your package (I found the link on oracledb git) because it seems that I have an issue with idle connections to oracle. I use your modified pool.getConnection for this, but it doesn't fixes my problem. The Problem is, that the pool connections seems to look healthy but sending a SELECT 1 FROM DUAL returns simply silence. I don't know where the issue is (client or server). Releasing the connection and force the pool to rebuild the connection seems to fix that.
So my question is, is there somewhere in your library an option to define a timeout on outstanding server response? It seems that your getConnections wait endless for return of the SELECT 1 FROM DUAL and doesn't release this connection, after a while with no response, as dead and try a new one. So my code is waiting endless to get a connection. I hope I wrote understandable.
The code I use to create the pool with parameters, allmost as suggested in your readme
The text was updated successfully, but these errors were encountered: