asserted coverity resource leak issues#599
Conversation
|
cloudstack-pull-rats #68 SUCCESS |
|
cloudstack-pull-requests #765 UNSTABLE |
|
cloudstack-pull-analysis #1 ABORTED |
There was a problem hiding this comment.
Connection is used in ConnectionConcierge object. There will be failure somewhere else if Connection get GC'ed.
There was a problem hiding this comment.
yes, you are right. it needs to be addressed though. I think the close should then happen in the catch instead of automatically.
There was a problem hiding this comment.
Or you can put it in finally based on concierge is created or not.
There was a problem hiding this comment.
ok :
Connection conn = null;
try {
conn = TransactionLegacy.getStandaloneConnectionWithException();
conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
conn.setAutoCommit(true);
_concierge = new ConnectionConcierge("LockMaster", conn, true);
} catch (SQLException e) {
s_logger.error("Unable to get a new db connection", e);
throw new CloudRuntimeException("Unable to initialize a connection to the database for locking purposes", e);
} finally {
if (_concierge == null && conn != null) {
try {
conn.close();
} catch (SQLException e) {
s_logger.debug("closing connection failed after everything else.", e);
}
}
There was a problem hiding this comment.
having said that, doesn't it make sense to make the goncierge cloasble as well?
There was a problem hiding this comment.
Not needed based on its usage in code. The finalize() method is anyway there.
800604c to
c634b5d
Compare
|
cloudstack-pull-rats #76 SUCCESS |
|
cloudstack-pull-requests #774 SUCCESS |
|
LGTM |
|
cloudstack-pull-analysis #9 SUCCESS |
Signed-off-by: Daan Hoogland <daan@onecht.net> This closes apache#599
* Fix page navigation error when delete template. * removed double `!` syntax Fixes #598 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

No description provided.