-
Notifications
You must be signed in to change notification settings - Fork 187
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
Logstash 2.3.3 not closing JDBC connections #147
Comments
I have same problem in MYSQL. version 2.4 |
This is a big problem. When logstash starts it opens the connection, even if the scheduling is used. I have ~500 SQL queries scheduled and when logstash starts it opens ~500 connections, even though it doesn't need to open them yet. And it never closes them. There should be a pool of a few connections to share; or even open and close the connection for each query that is run. |
Leaking connections is definitely not behavior we want the plugin to have. Thank you for reporting. |
+1 The same |
Guys, We have found a solution to this problem. We somehow managed to slightly change the jdbc plugins source code in order to achieve what we want. Will share the fix what we have done, shortly with you. Hope it helps everyone. |
Hi @Kirangurrala , Could you please share your fix? |
Are there any updates on this issue? |
Hi, I submitted a pull request to fix this. Thanks. |
The fix for this has been released:
|
I have the same issue with Logstash 7.2 version when sync mongo to Eslastic. it will open new connection for each schedule. [2019-07-12T09:34:00,216][INFO ][org.mongodb.driver.connection] Opened connection [connectionId{localValue:53, serverValue:197}] to 192.168.99.34:27017 So I use the command " netstat -an|grep 27017|wc -l" to check connection number, and found the number is incremented for each schedule time. |
Please post all product and debugging questions on our forum. Your questions will reach our wider community members there, and if we confirm that there is a bug, then we can open a new issue here.
Issue: JDBC is never closing the connection from the database(Oracle), it opened for running the sql request.
For all general issues, please provide the following details for fast resolution:
Version: 2.3.3
Operating System: Linux
Config File (if you have sensitive info, please remove it):
input {
jdbc {
# Connection credentials
jdbc_connection_string => "jdbc:oracle:thin:@host:PORT/"
jdbc_user => ""
jdbc_password => ""
jdbc_driver_library => "$HOME/logstash-2.3.3/db/ojdbc6-11.2.0.4.jar"
jdbc_driver_class => "Java::oracle.jdbc.driver.OracleDriver"
}
output {
stdout {}
}
Sample Data:
COL1 COL2 START_DATE ACTIVE
502 503 29-JUN-16 02.58.52 PM 1
311 312 27-JUN-16 04.17.54 PM 1
Steps to Reproduce:
Create a table test_logstash with 4columns - COL1, COL2, START_DATE, ACTIVE
Inserting the data above into the table
Then using the above conf statement, start the logstash.
JDBC will connect to oracle and the JDBC user LOGON time on oracle will never change for every run of the above sql statement (which means that JDBC is not disconnecting the previously opened connection)
The text was updated successfully, but these errors were encountered: