Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0037055 | Openbravo ERP | A. Platform | public | 2017-10-11 14:10 | 2018-01-03 12:38 |
|
Reporter | caristu | |
Assigned To | caristu | |
Priority | high | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR18Q1 | |
Merge Request Status | |
Review Assigned To | alostale |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0037055: Connection leak in threads that makes use of the read only pool and are not encapsulated inside DalThreadHandler |
Description | Connection 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 Reproduce | 1) 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 Solution | Close the opened sessions in the ImportEntryProcessRunnable when it ends, in the same way as the DalThreadHandler does. |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | design defect | 0036291 | | acknowledged | Triage Platform Base | even not configured, RO pool uses a different pool instance | related to | feature request | 0034816 | | closed | caristu | Support a second database for reporting |
|
Attached Files | org.openbravo.externaldata.integration.examples.tar.gz (4,841) 2017-10-11 14:10 https://issues.openbravo.com/file_download.php?file_id=11170&type=bug issue37055.diff (3,757) 2017-10-11 18:58 https://issues.openbravo.com/file_download.php?file_id=11175&type=bug |
|
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 | bug_revision_view_page.php?rev_id=16064#r16064 |
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 | bug_revision_view_page.php?bugnote_id=0099872#r16066 |
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 | |
Notes |
|
(0099916)
|
hgbot
|
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
|
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
---
|
|
|
|
reviewed
tested with Import entry and background processes |
|
|
|
|
|
|
|