Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037611Retail ModulesStoreServerpublic2018-01-10 17:392018-01-29 11:32
ioritzCia 
AugustoMauch 
highmajoralways
closedfixed 
5
 
 
mtaal
No
0037611: Store data validator background process leaves open connections
Store data validator background process leaves open connections in createMaterializedView method
Configure the Openbravo.properties to log abandoned suspects
Execute the background process
Check the log for the error like in the attached file
No tags attached.
related to design defect 0037699 new AugustoMauch Connection leak if the Validate Store Server process is executed from the ERP using more than one thread 
log connectionLeakValidateBackground.log (2,402) 2018-01-10 17:40
https://issues.openbravo.com/file_download.php?file_id=11438&type=bug
Issue History
2018-01-10 17:39ioritzCiaNew Issue
2018-01-10 17:39ioritzCiaAssigned To => StoreServer
2018-01-10 17:39ioritzCiaTriggers an Emergency Pack => No
2018-01-10 17:40ioritzCiaFile Added: connectionLeakValidateBackground.log
2018-01-15 10:23mtaalAssigned ToStoreServer => AugustoMauch
2018-01-15 13:25ioritzCiaResolution time => 1517353200
2018-01-16 11:37hgbotCheckin
2018-01-16 11:37hgbotNote Added: 0101713
2018-01-16 11:37hgbotStatusnew => resolved
2018-01-16 11:37hgbotResolutionopen => fixed
2018-01-16 11:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/16cf100d79d6b4086fd292fc0baa7d887d73dae3 [^]
2018-01-16 12:26AugustoMauchReview Assigned To => mtaal
2018-01-16 23:04mtaalNote Added: 0101735
2018-01-22 16:25AugustoMauchRelationship addedrelated to 0037699
2018-01-22 16:32AugustoMauchNote Added: 0101854
2018-01-29 11:32mtaalNote Added: 0102009
2018-01-29 11:32mtaalStatusresolved => closed

Notes
(0101713)
hgbot   
2018-01-16 11:37   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 16cf100d79d6b4086fd292fc0baa7d887d73dae3
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jan 16 11:29:24 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/16cf100d79d6b4086fd292fc0baa7d887d73dae3 [^]

Fixes issue 37611: Store data validator process no longer leaks connections

The problem was that the connection used to create the materialized views was not being rollbacked and closed.

Now this is done by the RollbackMaterializedViews runnable, which is invoked on the ExecutorServer where the materialized views are created. The existing connection rollback has been removed because is no longer needed.

---
M src/org/openbravo/replication/symmetricds/validation/SynchronizationStoreDataValidator.java
---
(0101735)
mtaal   
2018-01-16 23:04   
Codereview comments:

Maybe add comment where the executorservice is created that singlethreadexecutor is important to ensure that the connection close at the end works on the same thread.

The standardExecutorService is not created as singlethreadexecutor. Is that on purpose, could there be a connection leak there to?
(0101854)
AugustoMauch   
2018-01-22 16:32   
Right now it is not possible to leak connections, but if the number of threads to be used to execute the background validator process were increased, there would be leaks. A new issue has been reported to cover this case [1].

As the fix is not easy, and it is currently not reproducible, I prefere to handle it in that separate design defect.

[1] https://issues.openbravo.com/view.php?id=37699 [^]
(0102009)
mtaal   
2018-01-29 11:32   
reviewed