Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-21058

Close sleep connections

XMLWordPrintable

      Hibernate plugin connections create 2 connection per database update but never removes them.

      Hibernate session is not close.

      Hibernate configuration:

              <property name="c3p0.max_size">10</property>
              <property name="c3p0.min_size">2</property>
              <property name="c3p0.timeout">1800</property>
              <property name="c3p0.max_statements">50</property>
              <property name="connection.autocommit">true</property>
      

      The problem is that max connections overrides defined value in hibernate (10) I have 12 (If I continue I have 2 connection for each register Job...). Every new Job registered with Audit2db retrieves 2 new connections.

      $ echo "SHOW PROCESSLIST" | mysql --user=jenkins --password=jenkins
      Id	User	Host	db	Command	Time	State	Info
      109	jenkins	localhost:48405	jenkinsdb	Sleep	299		NULL
      110	jenkins	localhost:48407	jenkinsdb	Sleep	1014		NULL
      111	jenkins	localhost:48408	jenkinsdb	Sleep	1014		NULL
      114	jenkins	localhost:48409	jenkinsdb	Sleep	241		NULL
      117	jenkins	localhost:48422	jenkinsdb	Sleep	235		NULL
      118	jenkins	localhost:48421	jenkinsdb	Sleep	2247		NULL
      131	jenkins	localhost:48438	jenkinsdb	Sleep	1921		NULL
      132	jenkins	localhost:48437	jenkinsdb	Sleep	1921		NULL
      133	jenkins	localhost:48440	jenkinsdb	Sleep	1914		NULL
      134	jenkins	localhost:48441	jenkinsdb	Sleep	1917		NULL
      152	jenkins	localhost:48459	jenkinsdb	Sleep	231		NULL
      153	jenkins	localhost:48460	jenkinsdb	Sleep	231		NULL
      157	jenkins	localhost:48461	jenkinsdb	Sleep	78		NULL
      158	jenkins	localhost:48462	jenkinsdb	Sleep	53		NULL
      159	jenkins	localhost	NULL	Query	0	NULL	SHOW PROCESSLIST
      

      The value representig timeout 1800 (secs) doesn't remove sleep connections.

      I think there is another value like `idle_test_period` that hast to be set (if I've understood the meaning) to remove idle connections.

      Or the problem is that hibernate connections have never been closed

      Thanks!

            ricardogarfe Ricardo García Fernández
            ricardogarfe Ricardo García Fernández
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: