Skip to content

asserted coverity resource leak issues#599

Closed
DaanHoogland wants to merge 3 commits into
apache:masterfrom
DaanHoogland:coverity-resource-leaks
Closed

asserted coverity resource leak issues#599
DaanHoogland wants to merge 3 commits into
apache:masterfrom
DaanHoogland:coverity-resource-leaks

Conversation

@DaanHoogland
Copy link
Copy Markdown
Contributor

No description provided.

@DaanHoogland DaanHoogland changed the title coverity 1116668: try-with-resource on ds provided connection asserted coverity resource leak issues Jul 16, 2015
@asfbot
Copy link
Copy Markdown

asfbot commented Jul 16, 2015

cloudstack-pull-rats #68 SUCCESS
This pull request looks good

@asfbot
Copy link
Copy Markdown

asfbot commented Jul 16, 2015

cloudstack-pull-requests #765 UNSTABLE
Looks like there's a problem with this pull request

@asfbot
Copy link
Copy Markdown

asfbot commented Jul 16, 2015

cloudstack-pull-analysis #1 ABORTED

@wilderrodrigues
Copy link
Copy Markdown
Contributor

I checked all 5 Travis jobs and they failed due to timeout. Thus, it LGTM 👍

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Connection is used in ConnectionConcierge object. There will be failure somewhere else if Connection get GC'ed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, you are right. it needs to be addressed though. I think the close should then happen in the catch instead of automatically.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or you can put it in finally based on concierge is created or not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having said that, doesn't it make sense to make the goncierge cloasble as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed based on its usage in code. The finalize() method is anyway there.

@DaanHoogland DaanHoogland force-pushed the coverity-resource-leaks branch from 800604c to c634b5d Compare July 17, 2015 09:49
@asfbot
Copy link
Copy Markdown

asfbot commented Jul 17, 2015

cloudstack-pull-rats #76 SUCCESS
This pull request looks good

@asfbot
Copy link
Copy Markdown

asfbot commented Jul 17, 2015

cloudstack-pull-requests #774 SUCCESS
This pull request looks good

@koushik-das
Copy link
Copy Markdown
Contributor

LGTM

@asfbot
Copy link
Copy Markdown

asfbot commented Jul 17, 2015

cloudstack-pull-analysis #9 SUCCESS
This pull request looks good

@asfgit asfgit closed this in 03b076c Jul 17, 2015
maneesha-p pushed a commit to maneesha-p/cloudstack that referenced this pull request Jul 31, 2015
Signed-off-by: Daan Hoogland <daan@onecht.net>

This closes apache#599
yadvr pushed a commit that referenced this pull request Jan 20, 2021
* Fix page navigation error when delete template.

* removed double `!` syntax

Fixes #598

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
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

Successfully merging this pull request may close these issues.

4 participants