Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036503Retail ModulesStoreServerpublic2017-07-17 01:402017-07-31 17:04
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
RR17Q3 
AugustoMauch
No
0036503: Store server version provider has connection leak if server version computation is done in separate thread
The code here [1] runs in a separate thread and checks if the symmetric ds table has been created [2]. This check opens a dal connection which is not closed.

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/file/b03057ff4b63/src/org/openbravo/retail/storeserver/synchronization/StoreServerVersionHandler.java#l411 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/file/b03057ff4b63/src/org/openbravo/retail/storeserver/synchronization/StoreServerVersionHandler.java#l419 [^]

[3]
Jul 17, 2017 1:37:15 AM org.apache.tomcat.jdbc.pool.ConnectionPool suspect
WARNING: Connection has been marked suspect, possibly abandoned PooledConnection[org.postgresql.jdbc.PgConnection@3d51df43][83875 ms.]:java.lang.Exception
    at org.apache.tomcat.jdbc.pool.ConnectionPool.getThreadDump(ConnectionPool.java:1096)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:799)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:648)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:200)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:128)
    at org.openbravo.apachejdbcconnectionpool.JdbcExternalConnectionPool.getConnectionFromDS(JdbcExternalConnectionPool.java:134)
    at org.openbravo.apachejdbcconnectionpool.JdbcExternalConnectionPool.getConnection(JdbcExternalConnectionPool.java:114)
    at org.openbravo.dal.core.SessionHandler.getNewConnection(SessionHandler.java:300)
    at org.openbravo.dal.core.SessionHandler.createSession(SessionHandler.java:235)
    at org.openbravo.dal.core.SessionHandler.begin(SessionHandler.java:561)
    at org.openbravo.dal.core.SessionHandler.getSession(SessionHandler.java:183)
    at org.openbravo.dal.service.OBDal.getConnection(OBDal.java:193)
    at org.openbravo.service.db.DalConnectionProvider.getConnection(DalConnectionProvider.java:95)
    at org.openbravo.service.db.DalConnectionProvider.getPreparedStatement(DalConnectionProvider.java:158)
    at org.openbravo.retail.storeserver.synchronization.StoreServerVersionHandler.symmetricDsTriggersAreCreated(StoreServerVersionHandler.java:392)
    at org.openbravo.retail.storeserver.synchronization.StoreServerVersionHandler.isSymmetricDSReady(StoreServerVersionHandler.java:383)
    at org.openbravo.retail.storeserver.synchronization.StoreServerVersionHandler.access$1(StoreServerVersionHandler.java:382)
    at org.openbravo.retail.storeserver.synchronization.StoreServerVersionHandler$2.run(StoreServerVersionHandler.java:422)
    at java.lang.Thread.run(Thread.java:745)
Install multi-server
Set the following parameters in Openbravo.properties
db.pool.logAbandoned=true
db.pool.suspectTimeout=30

Somehow let the version computation code start the separate thread. This can be done by changing the code slightly
Close the connection in the separate thread
No tags attached.
Issue History
2017-07-17 01:40mtaalNew Issue
2017-07-17 01:40mtaalAssigned To => mtaal
2017-07-17 01:40mtaalTriggers an Emergency Pack => No
2017-07-21 23:52mtaalReview Assigned To => AugustoMauch
2017-07-22 00:05hgbotCheckin
2017-07-22 00:05hgbotNote Added: 0098181
2017-07-22 00:05hgbotStatusnew => resolved
2017-07-22 00:05hgbotResolutionopen => fixed
2017-07-22 00:05hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/d2b3f0abb40cd17eb73a3afb5b1ffda1f9ae4e8b [^]
2017-07-31 17:04AugustoMauchNote Added: 0098282
2017-07-31 17:04AugustoMauchStatusresolved => closed

Notes
(0098181)
hgbot   
2017-07-22 00:05   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: d2b3f0abb40cd17eb73a3afb5b1ffda1f9ae4e8b
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Jul 22 00:04:57 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/d2b3f0abb40cd17eb73a3afb5b1ffda1f9ae4e8b [^]

Fixes issue 36503: Store server version provider has connection leak if server version computation is done in separate thread
Move the try/finally block so that it encapsulates more code

---
M src/org/openbravo/retail/storeserver/synchronization/StoreServerVersionHandler.java
---
(0098282)
AugustoMauch   
2017-07-31 17:04   
Code reviewed