-
Notifications
You must be signed in to change notification settings - Fork 20
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
How to close the redisgraph connections #59
Comments
Thanks, @BhanuPrakash531 |
What kind of leak log are you referring here? |
@BhanuPrakash531 |
We get too many open connections errors on the logs and database is the only connection we have in our application |
@BhanuPrakash531 |
Configuration:
Service
Service caller
Health Check:
|
hi @BhanuPrakash531 |
Added the Service caller above which calls the redisgraph.query.
|
@BhanuPrakash531 it seems like the fact you're opening so many connection pools so fast is overloading the JMX unregister. private boolean isDBConnected() {
boolean isConnected = false;
try (Jedis jedis = this.pool.getResource()) {
if (jedis.ping().equalsIgnoreCase("PONG"))
isConnected = true;
}
return isConnected;
} |
@BhanuPrakash531 |
Agreed @gkorland, for health checks to database servers, whats the recommended approach to handle this scenario from java services by using RedisGraph APIs? |
What is the reason for these checks? are you running a general Redis monitor? |
No. We have developed an application on top of redis graph, other services which uses our service does a frequent healt checks on our application, we need to check the health of redis database for each of the request we get. Hence we need that operation |
@BhanuPrakash531 you need a health check for the RedisGraph API? |
@BhanuPrakash531 In second thought, you can get a dedicated Jedis resource from the RedisGraphAPI by
so you'll have full Jedis API as well as GraphAPI with this connection. |
Okay. Thanks for the above block of code, that helps. One last question, where does the connection opened for |
you mean to
? |
So that will be closed when the server is stopped? Or is there a best practice to close it? |
@BhanuPrakash531
|
Alright, thanks for the response. This helps. Appreciated. |
Hi Team,
I'm looking for a template how to close the redisgraph connection obtained from the JedisPool to handle the resource leakage. How can we achieve this on JRedisGraph dependency?
Below is an excerpt of the code that gets the RedisGraph API which is used by other classes to execute queries against the database.
We are then calling the created bean directly to send query to database, this is resulting on resource leakage
The text was updated successfully, but these errors were encountered: