Skip to content
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

Connection Pooling issue #26

Closed
lakshmisri opened this issue Aug 24, 2015 · 35 comments
Closed

Connection Pooling issue #26

lakshmisri opened this issue Aug 24, 2015 · 35 comments

Comments

@lakshmisri
Copy link

Hi,

I have used Yank manager for my database connection but beyond a point of time, I am getting "Too many connections". Do I need to handle separately for connection pooling.

@timmolter
Copy link
Member

Thanks for reporting the issue. I've never seen that before. Can you paste the entire message here?

@lakshmisri
Copy link
Author

I am using Sundial and Yank for scheduling jobs. I have about 2 batch jobs
and they are scheduled to be executed every 5 min. THe connection
properties that I have used are

jdbcUrl=jdbc:mysql://localhost/localDB
username=root
password=
maximumPoolSize=20

DEBUG [00:25:02.788] [HikariCP connection filler (pool HikariPool-0)]
c.z.h.p.PoolUtilities - Closing connection null
DEBUG [00:25:02.789] [HikariCP connection filler (pool HikariPool-0)]
c.z.h.p.HikariPool - Connection attempt to database HikariPool-0 failed:
Data source rejected establishment of connection, message from server:
"Too many connections"
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data
source rejected establishment of connection, message from server: "Too
many connections"
at sun.reflect.GeneratedConstructorAccessor62.newInstance(Unknown Source)
~[na:na]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) ~[na:1.8.0_51]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[na:1.8.0_51]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.Util.getInstance(Util.java:386)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1114)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:834)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at sun.reflect.GeneratedConstructorAccessor57.newInstance(Unknown Source)
~[na:na]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) ~[na:1.8.0_51]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[na:1.8.0_51]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:83)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:89)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.zaxxer.hikari.pool.BaseHikariPool.addConnection(BaseHikariPool.java:409)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.zaxxer.hikari.pool.HikariPool$1AddConnection.run(HikariPool.java:78)
[cleanIndiaService-0.8.0.jar:0.8.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[na:1.8.0_51]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Tue, Aug 25, 2015 at 1:13 AM, Tim Molter notifications@github.com
wrote:

Thanks for reporting the issue. I've never seen that before. Can you paste
the entire message here?


Reply to this email directly or view it on GitHub
#26 (comment).

@lakshmisri
Copy link
Author

I have just two batch jobs. Assuming one connection per job, it should go
back to the pool. That is my assumption and I have not handled anything
explicitly to return the connection object to the pool.

Regards,
Lakshmisri Gopalan

On Tue, Aug 25, 2015 at 2:27 AM, Lakshmisri Gopalan <lakshmisri@ideas2it.com

wrote:

I am using Sundial and Yank for scheduling jobs. I have about 2 batch jobs
and they are scheduled to be executed every 5 min. THe connection
properties that I have used are

jdbcUrl=jdbc:mysql://localhost/localDB
username=root
password=
maximumPoolSize=20

DEBUG [00:25:02.788] [HikariCP connection filler (pool HikariPool-0)]
c.z.h.p.PoolUtilities - Closing connection null
DEBUG [00:25:02.789] [HikariCP connection filler (pool HikariPool-0)]
c.z.h.p.HikariPool - Connection attempt to database HikariPool-0 failed:
Data source rejected establishment of connection, message from server:
"Too many connections"
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data
source rejected establishment of connection, message from server: "Too
many connections"
at sun.reflect.GeneratedConstructorAccessor62.newInstance(Unknown Source)
~[na:na]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) ~[na:1.8.0_51]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[na:1.8.0_51]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.Util.getInstance(Util.java:386)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1114)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2493)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2526)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2311)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:834)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at sun.reflect.GeneratedConstructorAccessor57.newInstance(Unknown Source)
~[na:na]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source) ~[na:1.8.0_51]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[na:1.8.0_51]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:347)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:83)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:89)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.zaxxer.hikari.pool.BaseHikariPool.addConnection(BaseHikariPool.java:409)
~[cleanIndiaService-0.8.0.jar:0.8.0]
at
com.zaxxer.hikari.pool.HikariPool$1AddConnection.run(HikariPool.java:78)
[cleanIndiaService-0.8.0.jar:0.8.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[na:1.8.0_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[na:1.8.0_51]
at java.lang.Thread.run(Unknown Source) [na:1.8.0_51]

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Tue, Aug 25, 2015 at 1:13 AM, Tim Molter notifications@github.com
wrote:

Thanks for reporting the issue. I've never seen that before. Can you
paste the entire message here?


Reply to this email directly or view it on GitHub
#26 (comment).

@lakshmisri
Copy link
Author

Hi.. I think you need to upgrade your Hikari jar to higher version. Looks that they have fixed this issue in 2.3.7 onwards. I am using Yank with jdk 7. So they have a stable release yesterday which is 2.4.1

@timmolter
Copy link
Member

@lakshmisri Thanks for the suggestion. I updated the Hikari jar. Can you please try out the latest Yank snapshot jar?

BTW, I will probably update Yank to Java 7 soon and at that time bump up to the Hikari 2.4.x jar.

@lakshmisri
Copy link
Author

Yeah that will be fine. I am using Java 7 but still your Yank is working
good :)

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Tue, Aug 25, 2015 at 3:12 PM, Tim Molter notifications@github.com
wrote:

@lakshmisri https://github.com/lakshmisri Thanks for the suggestion. I
updated the Hikari jar. Can you please try out the latest Yank snapshot jar?

BTW, I will probably update Yank to Java 7 soon and at that time bump up
to the Hikari 2.4.x jar.


Reply to this email directly or view it on GitHub
#26 (comment).

@timmolter
Copy link
Member

Can you confirm that the problem has now been definitely solved?

@lakshmisri
Copy link
Author

I have shared a link in the previous comment. Could you take a look at
that? I have also emailed the other team asking for the Java 6 stable
version.

On Tuesday, August 25, 2015, Tim Molter notifications@github.com wrote:

Can you confirm that the problem has now been definitely solved?


Reply to this email directly or view it on GitHub
#26 (comment).

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

@lakshmisri
Copy link
Author

Hi,
the pom.xml does not have the latest jar version, it still shows 2.3.6 but has to be 2.3.9

https://github.com/brettwooldridge/HikariCP

@timmolter
Copy link
Member

Thanks, I made a mistake. Try now as it should be working.

@lakshmisri
Copy link
Author

For some reason, its not downloading the dependancy. Does it take some time
for the dependancy to get reflected in maven?

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Tue, Aug 25, 2015 at 9:32 PM, Lakshmisri Gopalan <lakshmisri@ideas2it.com

wrote:

I have shared a link in the previous comment. Could you take a look at
that? I have also emailed the other team asking for the Java 6 stable
version.

On Tuesday, August 25, 2015, Tim Molter notifications@github.com wrote:

Can you confirm that the problem has now been definitely solved?


Reply to this email directly or view it on GitHub
#26 (comment).

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

@timmolter
Copy link
Member

The dependency is there: https://oss.sonatype.org/content/groups/public/com/xeiam/yank/3.0.2-SNAPSHOT/

You're aware that it's a snapshot jar, right?

@lakshmisri
Copy link
Author

I am using 3.0.1 and not snapshot..

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Wed, Aug 26, 2015 at 2:01 PM, Tim Molter notifications@github.com
wrote:

The dependency is there:
https://oss.sonatype.org/content/groups/public/com/xeiam/yank/3.0.2-SNAPSHOT/

You're aware that it's a snapshot jar, right?


Reply to this email directly or view it on GitHub
#26 (comment).

@timmolter
Copy link
Member

You need to use 3.0.2-SNAPSHOT for the latest changes

@timmolter
Copy link
Member

Read the README file for more info.

@lakshmisri
Copy link
Author

Is this a stable version?

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Wed, Aug 26, 2015 at 3:14 PM, Tim Molter notifications@github.com
wrote:

Read the README file for more info.


Reply to this email directly or view it on GitHub
#26 (comment).

@timmolter
Copy link
Member

No, it's a snapshot version. I'll release a stable version after I know it's tested and the problem is fixed.

@lakshmisri
Copy link
Author

I have put that in my code. Give me a day or two. I will monitor that and
let you know .

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Wed, Aug 26, 2015 at 3:38 PM, Tim Molter notifications@github.com
wrote:

No, it's a snapshot version. I'll release a stable version after I know
it's tested and the problem is fixed.


Reply to this email directly or view it on GitHub
#26 (comment).

@timmolter
Copy link
Member

Thanks much. I hope it solves the issue!

@lakshmisri
Copy link
Author

Even if i use the snapshot jar, it is not referring to the new hikari jar

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Wed, Aug 26, 2015 at 10:42 PM, Lakshmisri Gopalan <
lakshmisri@ideas2it.com> wrote:

I have put that in my code. Give me a day or two. I will monitor that and
let you know .

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Wed, Aug 26, 2015 at 3:38 PM, Tim Molter notifications@github.com
wrote:

No, it's a snapshot version. I'll release a stable version after I know
it's tested and the problem is fixed.


Reply to this email directly or view it on GitHub
#26 (comment).

@timmolter
Copy link
Member

That's hard to believe. Are you sure you're using 3.0.2-SNAPSHOT and not 3.0.1-SNAPSHOT ?

@timmolter
Copy link
Member

It should be referring to 2.3.9

@lakshmisri
Copy link
Author

Which one to use. Ur read me said 3.0.2 snapshot

On Wednesday, August 26, 2015, Tim Molter notifications@github.com wrote:

It should be referring to 2.3.9


Reply to this email directly or view it on GitHub
#26 (comment).

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

@timmolter
Copy link
Member

Yank 3.0.2-SNAPSHOT

which depends on hikariCP-java6 2.3.9

@lakshmisri
Copy link
Author

That is what I have referred to but its not referring to the new one.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Wed, Aug 26, 2015 at 11:36 PM, Tim Molter notifications@github.com
wrote:

Yank 3.0.2-SNAPSHOT

which depends on hikariCP-java6 2.3.9


Reply to this email directly or view it on GitHub
#26 (comment).

@timmolter
Copy link
Member

You probably have a maven issue. If I look at the deployed snapshot jar on Sonatype, the pom is correct, showing the appropriate Hikari dependency.

screen shot 2015-08-27 at 8 33 56 am

@lakshmisri
Copy link
Author

Ok it is fine now. I will monitor until end of day today and let you know
if I see any connection pooling issues.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Thu, Aug 27, 2015 at 12:05 PM, Tim Molter notifications@github.com
wrote:

You probably have a maven issue. If I look at the deployed snapshot jar on
Sonatype, the pom is correct, showing the appropriate Hikari dependency.

[image: screen shot 2015-08-27 at 8 33 56 am]
https://cloud.githubusercontent.com/assets/738972/9514037/992a71b0-4c96-11e5-8b55-16899739d6ac.png


Reply to this email directly or view it on GitHub
#26 (comment).

@lakshmisri
Copy link
Author

Hello,

its about 1.5 days and looks there I am not getting that issue anymore.

Regards,
Lakshmi

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Thu, Aug 27, 2015 at 12:58 PM, Lakshmisri Gopalan <
lakshmisri@ideas2it.com> wrote:

Ok it is fine now. I will monitor until end of day today and let you know
if I see any connection pooling issues.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Thu, Aug 27, 2015 at 12:05 PM, Tim Molter notifications@github.com
wrote:

You probably have a maven issue. If I look at the deployed snapshot jar
on Sonatype, the pom is correct, showing the appropriate Hikari dependency.

[image: screen shot 2015-08-27 at 8 33 56 am]
https://cloud.githubusercontent.com/assets/738972/9514037/992a71b0-4c96-11e5-8b55-16899739d6ac.png


Reply to this email directly or view it on GitHub
#26 (comment).

@lakshmisri
Copy link
Author

Hello Tim,

so far no issues and the code is deployed, up and running without issues
for over three days.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Fri, Aug 28, 2015 at 11:35 AM, Lakshmisri Gopalan <
lakshmisri@ideas2it.com> wrote:

Hello,

its about 1.5 days and looks there I am not getting that issue anymore.

Regards,
Lakshmi

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Thu, Aug 27, 2015 at 12:58 PM, Lakshmisri Gopalan <
lakshmisri@ideas2it.com> wrote:

Ok it is fine now. I will monitor until end of day today and let you know
if I see any connection pooling issues.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Thu, Aug 27, 2015 at 12:05 PM, Tim Molter notifications@github.com
wrote:

You probably have a maven issue. If I look at the deployed snapshot jar
on Sonatype, the pom is correct, showing the appropriate Hikari dependency.

[image: screen shot 2015-08-27 at 8 33 56 am]
https://cloud.githubusercontent.com/assets/738972/9514037/992a71b0-4c96-11e5-8b55-16899739d6ac.png


Reply to this email directly or view it on GitHub
#26 (comment).

@timmolter
Copy link
Member

That's great! Thank you very much for testing that our for me and reporting back. I'll release a stable jar within the week some time.

@lakshmisri
Copy link
Author

Sure. Could you let me know when you are done so that I can switch over.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Mon, Aug 31, 2015 at 2:11 PM, Tim Molter notifications@github.com
wrote:

That's great! Thank you very much for testing that our for me and
reporting back. I'll release a stable jar within the week some time.


Reply to this email directly or view it on GitHub
#26 (comment).

@lakshmisri
Copy link
Author

Have you made a release?

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Mon, Aug 31, 2015 at 3:22 PM, Lakshmisri Gopalan <lakshmisri@ideas2it.com

wrote:

Sure. Could you let me know when you are done so that I can switch over.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Mon, Aug 31, 2015 at 2:11 PM, Tim Molter notifications@github.com
wrote:

That's great! Thank you very much for testing that our for me and
reporting back. I'll release a stable jar within the week some time.


Reply to this email directly or view it on GitHub
#26 (comment).

@timmolter
Copy link
Member

No. I'll try to get it this weekend.

~Tim

On 9/2/15 8:48 PM, lakshmisri wrote:

Have you made a release?

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Mon, Aug 31, 2015 at 3:22 PM, Lakshmisri Gopalan <lakshmisri@ideas2it.com

wrote:

Sure. Could you let me know when you are done so that I can switch over.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Mon, Aug 31, 2015 at 2:11 PM, Tim Molter notifications@github.com
wrote:

That's great! Thank you very much for testing that our for me and
reporting back. I'll release a stable jar within the week some time.


Reply to this email directly or view it on GitHub
#26 (comment).


Reply to this email directly or view it on GitHub
#26 (comment).

@timmolter
Copy link
Member

It's now on Maven Central 3.0.2

On 9/2/15 8:48 PM, lakshmisri wrote:

Have you made a release?

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Mon, Aug 31, 2015 at 3:22 PM, Lakshmisri Gopalan <lakshmisri@ideas2it.com

wrote:

Sure. Could you let me know when you are done so that I can switch over.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Mon, Aug 31, 2015 at 2:11 PM, Tim Molter notifications@github.com
wrote:

That's great! Thank you very much for testing that our for me and
reporting back. I'll release a stable jar within the week some time.


Reply to this email directly or view it on GitHub
#26 (comment).


Reply to this email directly or view it on GitHub
#26 (comment).

@lakshmisri
Copy link
Author

Thanks Tim. I will also change my configuration.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Sat, Sep 5, 2015 at 3:13 PM, Tim Molter notifications@github.com wrote:

It's now on Maven Central 3.0.2

On 9/2/15 8:48 PM, lakshmisri wrote:

Have you made a release?

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Mon, Aug 31, 2015 at 3:22 PM, Lakshmisri Gopalan <
lakshmisri@ideas2it.com

wrote:

Sure. Could you let me know when you are done so that I can switch over.

Regards,
Lakshmisri Gopalan
IDEAS2IT Technologies

On Mon, Aug 31, 2015 at 2:11 PM, Tim Molter notifications@github.com
wrote:

That's great! Thank you very much for testing that our for me and
reporting back. I'll release a stable jar within the week some time.


Reply to this email directly or view it on GitHub
#26 (comment).


Reply to this email directly or view it on GitHub
#26 (comment).


Reply to this email directly or view it on GitHub
#26 (comment).

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

No branches or pull requests

2 participants