Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037055
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2017-10-11 14:102018-01-03 12:38
ReportercaristuView Statuspublic 
Assigned Tocaristu 
PriorityhighResolutionfixedFixed in Version3.0PR18Q1
StatusclosedFix in branchFixed in SCM revision70081b11d3a4
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037055: Connection leak in threads that makes use of the read only pool and are not encapsulated inside DalThreadHandler

DescriptionConnection leak in threads that makes use of the read only pool and are not encapsulated inside DalThreadHandler.

This problem affects:

- Classes extending ImportEntryProcessRunnable (MobileImportEntryProcessorRunnable in WebPOS, EDLEntryProcessRunnable in EDL module)

- Classes extending DALBaseProcess (background process)
Steps To Reproduce1) Install the attached module, it contains an EDL process which does a dummy usage of the read only pool on its item processor.
2) Log-in and navigate to the [Import UOM] process window.
3) Execute select state,* from pg_stat_activity where state = 'idle in transaction' --> 0 records returned
4) Being on the [Import UOM] window, click on the "Done" button in order to execute the process
5) Execute select state,* from pg_stat_activity where state = 'idle in transaction' --> 1 record returned!
Proposed SolutionClose the opened sessions in the ImportEntryProcessRunnable when it ends, in the same way as the DalThreadHandler does.
TagsNo tags attached.
Attached Filesgz file icon org.openbravo.externaldata.integration.examples.tar.gz [^] (4,841 bytes) 2017-10-11 14:10
diff file icon issue37055.diff [^] (3,757 bytes) 2017-10-11 18:58 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0036291 acknowledgedplatform even not configured, RO pool uses a different pool instance 
related to feature request 0034816 closedcaristu Support a second database for reporting 

-  Notes
(0099916)
hgbot (developer)
2017-10-16 09:50

Repository: erp/devel/pi
Changeset: fb697bb857f805552ed27c221a8433ae4761016d
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Oct 16 09:35:47 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fb697bb857f805552ed27c221a8433ae4761016d [^]

related to issue 37055: initial code clean up
  - Use diamond operator
  - In ImportEntryProcessRunnable class declaration, reorder the modifiers to comply with the Java Language Specification
  - Use && instead of &

---
M src/org/openbravo/service/importprocess/ImportEntryProcessor.java
---
(0099917)
hgbot (developer)
2017-10-16 10:25

Repository: erp/devel/pi
Changeset: 70081b11d3a49b91c9dcac9e5898b88c37548ab0
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Mon Oct 16 10:07:39 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/70081b11d3a49b91c9dcac9e5898b88c37548ab0 [^]

fixes bug 37055: RO pool not closed when used in thread out of DalThreadHandler

 Regular threads used in HTTP requests are encanpsulated inside DalThreadHandler which eventually takes care of closing the opened database sessions before the thread ends. But threads not encapsulated inside DalThreadHandler are not taking into account the scenario of having multiple sessions (pools) opened. They are just closing the default pool. Thus, this issue affects:
  a) ImportEntryProcessRunnable, which delegates into its subclasses the ability of handling the transaction commit/rollback. But just in case the subclasses does not handle it, the ImportEntryProcessRunnable should take care of closing all the opened sessions before ending (if any). This way its behavior will be the same as those threads running inside DalThreadHandler.
  b) DalBaseProcess, this class was neither taking into account the possibility of opening multiple pools during its execution. Now, all the opened database sessions are closed if the process has been marked to close the default database connection before ending.

---
M src/org/openbravo/dal/core/SessionHandler.java
M src/org/openbravo/service/db/DalBaseProcess.java
M src/org/openbravo/service/importprocess/ImportEntryProcessor.java
---
(0100023)
alostale (developer)
2017-10-24 13:01

reviewed

tested with Import entry and background processes
(0101331)
hudsonbot (developer)
2018-01-03 12:38

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/c81e0d3cbab5 [^]
Maturity status: Test
(0101332)
hudsonbot (developer)
2018-01-03 12:38

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/c81e0d3cbab5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-10-11 14:10 caristu New Issue
2017-10-11 14:10 caristu Assigned To => platform
2017-10-11 14:10 caristu File Added: org.openbravo.externaldata.integration.examples.tar.gz
2017-10-11 14:10 caristu Modules => Core
2017-10-11 14:10 caristu Triggers an Emergency Pack => No
2017-10-11 14:13 caristu Assigned To platform => caristu
2017-10-11 14:17 caristu Relationship added related to 0036291
2017-10-11 14:17 caristu Relationship added related to 0034816
2017-10-11 16:38 caristu Status new => scheduled
2017-10-11 17:00 caristu Summary Connection leak when having an ImportEntryProcessRunnable that makes use of the read only pool => Connection leak in threads that makes use of the read only pool and are not encapsulated inside DalThreadHandler
2017-10-11 17:00 caristu Description Updated View Revisions
2017-10-11 17:00 caristu Proposed Solution updated
2017-10-11 18:32 caristu File Added: issue37055.diff
2017-10-11 18:32 caristu Note Added: 0099872
2017-10-11 18:33 caristu Note Edited: 0099872 View Revisions
2017-10-11 18:58 caristu File Deleted: issue37055.diff
2017-10-11 18:58 caristu File Added: issue37055.diff
2017-10-16 09:50 hgbot Checkin
2017-10-16 09:50 hgbot Note Added: 0099916
2017-10-16 09:58 caristu Note Deleted: 0099872
2017-10-16 10:25 hgbot Checkin
2017-10-16 10:25 hgbot Note Added: 0099917
2017-10-16 10:25 hgbot Status scheduled => resolved
2017-10-16 10:25 hgbot Resolution open => fixed
2017-10-16 10:25 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/70081b11d3a49b91c9dcac9e5898b88c37548ab0 [^]
2017-10-16 10:27 caristu Review Assigned To => alostale
2017-10-24 13:01 alostale Note Added: 0100023
2017-10-24 13:01 alostale Status resolved => closed
2017-10-24 13:01 alostale Fixed in Version => 3.0PR18Q1
2018-01-03 12:38 hudsonbot Checkin
2018-01-03 12:38 hudsonbot Note Added: 0101331
2018-01-03 12:38 hudsonbot Checkin
2018-01-03 12:38 hudsonbot Note Added: 0101332


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker