Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036385Retail ModulesStoreServerpublic2017-07-03 11:002017-07-31 09:24
AugustoMauch 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
RR17Q3RR17Q3 
AugustoMauch
Packaging and release
2017-06-08
RR17Q2
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5b9d05b616c97890bac563e72fcc415931f75f89 [^]
No
0036385: Connection leak in ServerStateBackground is there are no servers to ping
This changeset [1] fixed a connection leak in ServerStateBackground, but only if there was at least one store server to be pinged from the central server. If there are none, connections are still being leaked:

[1] https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/7edfb4a12cd4eec4d8a87c3a394b4c6ebd92ceae [^]
In a central server with no store server registered:
- Start tomcat
- Wait until the ServerStateBackground process is invoked. Each time it is invoked a connection will be leaked:

jul 03, 2017 10:56:07 AM org.apache.tomcat.jdbc.pool.ConnectionPool suspect
ADVERTENCIA: Connection has been marked suspect, possibly abandoned PooledConnection[org.postgresql.jdbc.PgConnection@5667c6bd][33259 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:130)
    at org.openbravo.apachejdbcconnectionpool.JdbcExternalConnectionPool.getConnection(JdbcExternalConnectionPool.java:110)
    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.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:353)
    at org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils.getKey(MobileAuthenticationKeyUtils.java:133)
    at org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils.encrypt(MobileAuthenticationKeyUtils.java:88)
    at org.openbravo.mobile.core.authenticate.MobileAuthenticationKeyUtils.getEncryptedAuthenticationToken(MobileAuthenticationKeyUtils.java:77)
    at org.openbravo.mobile.core.servercontroller.MobileServerUtils.getAuthenticationQueryParams(MobileServerUtils.java:198)
    at org.openbravo.mobile.core.servercontroller.ServerStateBackground$PingRunnable.run(ServerStateBackground.java:414)
No tags attached.
blocks defect 0036384 closed AugustoMauch Connection leak in ServerStateBackground is there are no servers to ping 
Issue History
2017-07-03 11:17AugustoMauchTypedefect => backport
2017-07-03 11:17AugustoMauchTarget Version => RR17Q3
2017-07-17 01:00mtaalAssigned ToAugustoMauch => mtaal
2017-07-17 15:19mtaalReview Assigned To => AugustoMauch
2017-07-17 15:22hgbotCheckin
2017-07-17 15:22hgbotNote Added: 0098104
2017-07-17 15:22hgbotStatusscheduled => resolved
2017-07-17 15:22hgbotResolutionopen => fixed
2017-07-17 15:22hgbotFixed in SCM revision => http://code.openbravo.com/retail/backports/3.0RR17Q3/org.openbravo.mobile.core/rev/1c80d277fbab48a50a5de2a942d2c00318674988 [^]
2017-07-31 09:24AugustoMauchNote Added: 0098268
2017-07-31 09:24AugustoMauchStatusresolved => closed
2017-07-31 09:24AugustoMauchFixed in Version => RR17Q3

Notes
(0098104)
hgbot   
2017-07-17 15:22   
Repository: retail/backports/3.0RR17Q3/org.openbravo.mobile.core
Changeset: 1c80d277fbab48a50a5de2a942d2c00318674988
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Jul 17 15:20:31 2017 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR17Q3/org.openbravo.mobile.core/rev/1c80d277fbab48a50a5de2a942d2c00318674988 [^]

Fixes issue 36385: Fixes connection leak in ServerStateBackground

Commits the connection outside the for loop, to ensure the connections is commited even if there are no store server to be pinged.

---
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
---
(0098268)
AugustoMauch   
2017-07-31 09:24   
Code reviewed and verified