|View Issue Details|
|Type||Category||Severity||Reproducibility||Date Submitted||Last Update|
|defect||[Openbravo ERP] A. Platform||major||have not tried||2014-10-15 14:37||2014-12-30 23:26|
|Priority||normal||Resolution||fixed||Fixed in Version||3.0PR15Q1|
|Status||closed||Fix in branch||Fixed in SCM revision||1643c8fecb96|
|OS Version||Database version||Ant version|
|Product Version||SCM revision|
|Review Assigned To||alostale|
|Regression introduced in release|
|Regression introduced by commit|
|Triggers an Emergency Pack||No|
0027877: Possible connection leak in UsageAudit.java in error case
|Description||Code in UsageAudit.java|
in the last function of that file.
Is doing getTransactionConnection which opens a new db connection.
And does 1 insert + releaseCommitconnection.
However in case of errors as those 3 catch blocks no releaeRollbackConnection is called.
That means that in those error cases the open connections i never closed.
That case is unlikely to trigger as that code is wrong as it is a long time.
However the effect will be very bad (unbounded db connection leak).
so reporting as major.
|Steps To Reproduce||-|
|Tags||No tags attached.|
edited on: 2014-12-01 14:09
-An exception has been forced to watch if it is true that connection leak exists in case of error. But it seems not to occur.
For testing this, the first step is to throw an exception to force to execute the code of the exceptions. The second step is to log in and end session as many times as wanted and after this, the last step, making a postgres query to look the connexions. After this test it seems not to exist any connection leak.
Anyway the releaseRollbackConnection has been added to the code, because it seems to be better this way.
Some tests have been performed:
-Firstly, an exception has been thrown for forcing to execute the new added code for exceptions. The code is reached correctly so it works as expected.
-A postgres query has been launched to check the connections to the data base.
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Mon Dec 01 15:22:06 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1643c8fecb96f82ac652260a49cffdf21f497320 [^]
Fixed issue 27877: No rollback is called in connection error catch.
It seemed to be possible to have a connection leak caused in the "UsageAudit.java" class.
That was because at the final function of this class in a try catch block there was no rollback done.
After some tests it seems not to be any connection leak even without the rollback. But the proper code
to make the rollback has been created, because it seems to be better that way.
For developing this, a new method has been created "releaseConnection". This method is called in the three
try catch blocks of the method "auditActionNoDal".
Now, if one of those excepcions are reached, a rollback will be done.
tested forcing execption in the code. Note before the fix is applied, the problem was not "only" leaked connections; if the exception occurred after the insert, uncommited transactions trying to insert elements in ad_session_usage_audit were kept forever; they could cause locks in ad_session due to FK resulting in completely stalling the whole session.
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.
Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/6525fe229e06 [^]
Maturity status: Test
|2014-10-15 14:37||shuehner||New Issue|
|2014-10-15 14:37||shuehner||Assigned To||=> AugustoMauch|
|2014-10-15 14:37||shuehner||Modules||=> Core|
|2014-10-15 14:37||shuehner||Triggers an Emergency Pack||=> No|
|2014-10-15 14:41||shuehner||Relationship added||related to 0027878|
|2014-11-28 09:20||alostale||Assigned To||AugustoMauch => NaroaIriarte|
|2014-12-01 13:48||NaroaIriarte||Note Added: 0072194|
|2014-12-01 14:09||NaroaIriarte||Note Edited: 0072194||View Revisions|
|2014-12-01 14:13||NaroaIriarte||Note Added: 0072196|
|2014-12-03 09:21||hgbot||Note Added: 0072257|
|2014-12-03 09:21||hgbot||Status||new => resolved|
|2014-12-03 09:21||hgbot||Resolution||open => fixed|
|2014-12-03 09:21||hgbot||Fixed in SCM revision||=> http://code.openbravo.com/erp/devel/pi/rev/1643c8fecb96f82ac652260a49cffdf21f497320 [^]|
|2014-12-03 09:25||alostale||Review Assigned To||=> alostale|
|2014-12-03 09:25||alostale||Note Added: 0072258|
|2014-12-03 09:25||alostale||Status||resolved => closed|
|2014-12-03 09:25||alostale||Fixed in Version||=> 3.0PR15Q1|
|2014-12-30 23:26||hudsonbot||Note Added: 0073166|
|Copyright © 2000 - 2009 MantisBT Group|