Openbravo Issue Tracking System - Retail Modules
View Issue Details
0041057Retail ModulesStoreServerpublic2019-06-07 18:272019-06-10 12:30
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
 
jarmendariz
No
0041057: Connection Leak when Storing server log in transition to online
This line [1] opens a connection but does not close it if the transition to online did not fail. The auto-close does not happen because this runs in a separate thread. See the stacktrace [2].

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/tip/src/org/openbravo/mobile/core/servercontroller/MobileServerController.java#l718 [^]

[2]
WARNING: Connection has been marked suspect, possibly abandoned PooledConnection[org.postgresql.jdbc.PgConnection@30f35965][54561 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:299)
    at org.openbravo.dal.core.SessionHandler.createSession(SessionHandler.java:234)
    at org.openbravo.dal.core.SessionHandler.begin(SessionHandler.java:575)
    at org.openbravo.dal.core.SessionHandler.getSession(SessionHandler.java:182)
    at org.openbravo.dal.core.SessionHandler.find(SessionHandler.java:534)
    at org.openbravo.dal.core.SessionHandler.find(SessionHandler.java:500)
    at org.openbravo.dal.service.OBDal.get(OBDal.java:359)
    at org.openbravo.mobile.core.servercontroller.MobileServerController.getThisServerDefinition(MobileServerController.java:410)
    at org.openbravo.mobile.core.servercontroller.MobileServerController$TransitionToOnline.run(MobileServerController.java:718)
    at java.lang.Thread.run(Thread.java:745)
Run multi-server, set status to OFF in the ss database for the store server mobile server record.
Run ServerStateBackground process
Do the commit after the if statement, or set the status in before the other commits.
No tags attached.
Issue History
2019-06-07 18:27mtaalNew Issue
2019-06-07 18:27mtaalAssigned To => mtaal
2019-06-07 18:27mtaalTriggers an Emergency Pack => No
2019-06-07 18:27hgbotCheckin
2019-06-07 18:27hgbotNote Added: 0112512
2019-06-07 18:27hgbotStatusnew => resolved
2019-06-07 18:27hgbotResolutionopen => fixed
2019-06-07 18:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1463fc25f6722c5b2080f7a7da63e0e5fea1f612 [^]
2019-06-07 18:28mtaalReview Assigned To => jarmendariz
2019-06-07 18:34mtaalProposed Solution updated
2019-06-08 16:55hgbotCheckin
2019-06-08 16:55hgbotNote Added: 0112515
2019-06-08 16:55hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1463fc25f6722c5b2080f7a7da63e0e5fea1f612 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/84057576dec03fcdec4ad7b0e2719ae238eef206 [^]
2019-06-10 12:30jarmendarizNote Added: 0112534
2019-06-10 12:30jarmendarizStatusresolved => closed

Notes
(0112512)
hgbot   
2019-06-07 18:27   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 1463fc25f6722c5b2080f7a7da63e0e5fea1f612
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Fri Jun 07 18:27:48 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1463fc25f6722c5b2080f7a7da63e0e5fea1f612 [^]

Fixes issue 41057: Connection Leak when Storing server log in transition to online
Do commit after the if

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerController.java
---
(0112515)
hgbot   
2019-06-08 16:55   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 84057576dec03fcdec4ad7b0e2719ae238eef206
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Jun 08 16:54:54 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/84057576dec03fcdec4ad7b0e2719ae238eef206 [^]

Fixes issue 41057: Connection Leak when Storing server log in transition to online
Seems better to set the status log in the same transaction as the status itself

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerController.java
---
(0112534)
jarmendariz   
2019-06-10 12:30   
Reviewed