[ https://issues.apache.org/jira/browse/CLOUDSTACK-409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Min Chen resolved CLOUDSTACK-409. --------------------------------- Resolution: Fixed Fixed through patch https://reviews.apache.org/r/7726/ > ThreadLocal Transaction and its db connection got reset for user managed db > connnection, causing ClusterHeartBeat thread frequently trying to get db > connection. > ---------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: CLOUDSTACK-409 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-409 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Management Server > Affects Versions: 4.0.0 > Reporter: Min Chen > Assignee: Min Chen > Priority: Critical > > If we want to reuse db connection, we will invoke > Transaction.transitToUserManagedConnection to manage our db connection > ourselves. However, this piece of code below > public void close() { > ......... > if(this._dbId == CONNECTED_DB) { > tls.set(_prev); > _prev = null; > s_mbean.removeTransaction(this); > } > } > will reset ThreadLocal transaction and close the connection, making reuse db > connection impossible. The impact of this bug is that currently > ClusterHeartBeat thread will keep acquiring db and releasing db connection > instead of keeping one connection when thread start, thus may cause MS > automatically shutdown in a heavy load environment where MS cannot get a db > connection. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira