Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-15575

"Dangerous use of multiple connections" - error reports wrong status of DB connection pool

      Issue Summary

      This issue is a continuation of JRASERVER-68409 but in a different scenario, basically email channels while processing emails requests from customers are reporting dangerous use of DB connection pool which is not true if we compare with any DB monitoring, this can mislead customers to let them think they have performance problems when only a cosmetic error is recording on files.

      Steps to Reproduce

      1. Install JSM (ie: 5.12.2)
      2. Configure a email box having a couple of emails, 10+
      3. Setup the email channel in JSM to create requests based on this email channel
      4. Jira logs will record the error on files but DB monitoring on admistrative tools is totally inside the requirements
        2024-09-19 21:38:48,649-0300 Caesium-1-3 WARN noreply@uogdemise.com     [c.a.jira.ofbiz.ConnectionPoolHealthSqlInterceptor] Dangerous use of multiple connections. Refer to Knowledge Base: https://go.atlassian.com/dangerous-use-of-multiple-connections
        java.lang.AssertionError: Explicit stack trace requested
        	at com.atlassian.jira.util.log.RateLimitingLogger.warnWithTrace(RateLimitingLogger.java:149)
        	at com.atlassian.jira.ofbiz.ConnectionPoolHealthSqlInterceptor$CountHolder.logWarn(ConnectionPoolHealthSqlInterceptor.java:236)
        	at com.atlassian.jira.ofbiz.ConnectionPoolHealthSqlInterceptor$CountHolder.replaced(ConnectionPoolHealthSqlInterceptor.java:264)
        	at com.atlassian.jira.ofbiz.ConnectionPoolHealthSqlInterceptor.onConnectionReplaced(ConnectionPoolHealthSqlInterceptor.java:94)
        	at com.atlassian.jira.ofbiz.ChainedSQLInterceptor.lambda$onConnectionReplaced$1(ChainedSQLInterceptor.java:70)
        	at com.atlassian.jira.ofbiz.ChainedSQLInterceptor.forEach(ChainedSQLInterceptor.java:93)
        	at com.atlassian.jira.ofbiz.ChainedSQLInterceptor.onConnectionReplaced(ChainedSQLInterceptor.java:69)
        	at org.ofbiz.core.entity.jdbc.interceptors.connection.SafeDelegatingSqlConnectionInterceptor.onConnectionReplaced(SafeDelegatingSqlConnectionInterceptor.java:39)
        	at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker$DelegatingConnectionImpl.close(ConnectionTracker.java:86)
        	at com.atlassian.jira.ofbiz.sql.ConnectionWrapper.close(ConnectionWrapper.java:77)
        	at com.atlassian.jira.diagnostic.connection.DiagnosticConnection.close(DiagnosticConnection.java:91)
        	at org.ofbiz.core.entity.TransactionUtil.closeAndClearThreadLocalConnection(TransactionUtil.java:416)
        	at org.ofbiz.core.entity.TransactionUtil.commitLocalTransaction(TransactionUtil.java:355)
        	at com.atlassian.core.ofbiz.util.CoreTransactionUtil.commit(CoreTransactionUtil.java:66)
        	at com.atlassian.jira.transaction.TransactionSupportImpl$TransactionImpl.commit(TransactionSupportImpl.java:86)
        	at com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister.updateValues(OfBizCustomFieldValuePersister.java:164)
        	at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.updateValues(EagerLoadingOfBizCustomFieldPersister.java:85)
        	at com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister.createValues(OfBizCustomFieldValuePersister.java:114)
        	at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.createValues(EagerLoadingOfBizCustomFieldPersister.java:73)
        	at com.atlassian.jira.issue.customfields.persistence.OfBizCustomFieldValuePersister.createValues(OfBizCustomFieldValuePersister.java:106)
        	at com.atlassian.jira.issue.customfields.persistence.EagerLoadingOfBizCustomFieldPersister.createValues(EagerLoadingOfBizCustomFieldPersister.java:67)
        	at com.atlassian.jira.issue.customfields.impl.AbstractSingleFieldType.createValue(AbstractSingleFieldType.java:144)
        	at com.atlassian.jira.issue.fields.ImmutableCustomField.createValue(ImmutableCustomField.java:701)
        

      Expected Results

      As a Jira admin I expect Jira to respect the correct amount of connection pool and report the error ONLY when the amount of connection pool is really in "dangerous".

      Actual Results

      Jira is reporting errors (see above) when the real usage of connection pool is OK

      Workaround

      Jira administrators should focus on the Database Monitoring page within Jira Administration console as that should be more accurate than the logs.

      Versions Tested

      Please confirm all versions that have been tested for this issue, and indicate whether the tested version is affected or not affected, below: 

      Testing Requirements Version Affected Version
      Customers Reported Version 5.12.12 (Yes)
      Most Recent Bug-Fix Release    
      Previous Major Release    
      Most Recent LTS    
      Previous Supported LTS    
      Other Versions.. 5.12.2 (No)

          Form Name

            [JSDSERVER-15575] "Dangerous use of multiple connections" - error reports wrong status of DB connection pool

            We just upgraded our client`s test JSM environment version to 5.12.11 and getting in logs warning (actually several times): 

            2024-10-19 22:06:27,437+0200 SdSerialisedOffThreadProcessor:thread-1 WARN anonymous     [c.a.jira.ofbiz.ConnectionPoolHealthSqlInterceptor] Dangerous use of multiple connections. Refer to Knowledge Base: https://go.atlassian.com/dangerous-use-of-multiple-connections
            java.lang.AssertionError: Explicit stack trace requested 

            But in this env there is no email channels configured. Could this cause environment restart for some reason? Server and DB support saying they didn`t had any planned works, but Jira restarted and some few second before it in logs there were several times this entry made.

            Edite Araja added a comment - We just upgraded our client`s test JSM environment version to 5.12.11 and getting in logs warning (actually several times):  2024-10-19 22:06:27,437+0200 SdSerialisedOffThreadProcessor:thread-1 WARN anonymous     [c.a.jira.ofbiz.ConnectionPoolHealthSqlInterceptor] Dangerous use of multiple connections. Refer to Knowledge Base: https://go.atlassian.com/dangerous-use-of-multiple-connections java.lang.AssertionError: Explicit stack trace requested  But in this env there is no email channels configured. Could this cause environment restart for some reason? Server and DB support saying they didn`t had any planned works, but Jira restarted and some few second before it in logs there were several times this entry made.

              c8bcca445054 Benjamin Suess
              a043f042db56 Jose Filho
              Affected customers:
              1 This affects my team
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: