Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036274
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2017-06-19 15:042017-06-23 11:04
ReporteralostaleView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in Version3.0PR17Q3
StatusclosedFix in branchFixed in SCM revisioncfd3f8102b4a
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036274: abandoned connection in SessionListener

DescriptionTwo cases:

1.

When a session is expired due to Tomcat's session timeout by SessionListener, the DB connection used in this thread is never returned to pool.

Note this occurs in case the actual thread invalidating the session is ContainerBackgroundProcessor. If it is invalidated through SessionExpirationFilter, the connection is correctly returned to pool. Latter case occurs ie. alert ping happens.

2.
When Tomcat is shut down having active sessions.
Steps To Reproduce1.1. Configure pool to log abandoned connections
1.2. Log in Openbravo
1.3. Close browser used to login (to prevent alert ping to invalidate session)
1.4. Wait until session expires due to time out
 -> check log:
Jun 19, 2017 2:55:42 PM org.apache.tomcat.jdbc.pool.ConnectionPool suspect
WARNING: Connection has been marked suspect, possibly abandoned PooledConnection[org.postgresql.jdbc.PgConnection@4b3fb2fb][10482 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:93)
    at org.openbravo.database.ConnectionProviderImpl.getNewConnection(ConnectionProviderImpl.java:260)
    at org.openbravo.database.ConnectionProviderImpl.getConnection(ConnectionProviderImpl.java:236)
    at org.openbravo.database.ConnectionProviderImpl.getPreparedStatement(ConnectionProviderImpl.java:369)
    at org.openbravo.database.ConnectionProviderImpl.getPreparedStatement(ConnectionProviderImpl.java:361)
    at org.openbravo.erpCommon.security.SessionLoginData.deactivate(SessionLoginData.java:81)
    at org.openbravo.erpCommon.security.SessionListener.deactivateSession(SessionListener.java:195)
    at org.openbravo.erpCommon.security.SessionListener.sessionDestroyed(SessionListener.java:65)

---

2.1 Configure pool to log abandoned connections
2.2 Log in Openbravo
2.3 Stop tomcat
  -> check log:
Jun 19, 2017 3:04:24 PM org.apache.tomcat.jdbc.pool.ConnectionPool abandon
WARNING: Connection has been abandoned PooledConnection[org.postgresql.jdbc.PgConnection@744cf1bd]: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:93)
    at org.openbravo.database.ConnectionProviderImpl.getNewConnection(ConnectionProviderImpl.java:260)
    at org.openbravo.database.ConnectionProviderImpl.getConnection(ConnectionProviderImpl.java:236)
    at org.openbravo.database.ConnectionProviderImpl.getPreparedStatement(ConnectionProviderImpl.java:369)
    at org.openbravo.database.ConnectionProviderImpl.getPreparedStatement(ConnectionProviderImpl.java:361)
    at org.openbravo.erpCommon.security.SessionLoginData.deactivate(SessionLoginData.java:81)
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0036261 closedalostale connections logged as abandoned in translate task 
has duplicate defect 0023882 closedalostale 2 dangling DB connections after Tomcat start 

-  Notes
(0097478)
hgbot (developer)
2017-06-19 15:17

Repository: erp/devel/pi
Changeset: cfd3f8102b4a1b9b3382a70128459cd258835ffa
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Jun 19 15:16:26 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/cfd3f8102b4a1b9b3382a70128459cd258835ffa [^]

fixed bug 36274: abandoned connection in SessionListener

  Detach connection from current thread to allow it to be properly returned
  to pool.

  This is required whever the thread doing the actio is not handling an standard
  request.

---
M src/org/openbravo/erpCommon/security/SessionListener.java
---
(0097518)
hudsonbot (developer)
2017-06-20 16:31

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/8518c867b17c [^]
Maturity status: Test
(0097602)
caristu (developer)
2017-06-23 11:04

Code reviewed

- Issue History
Date Modified Username Field Change
2017-06-19 15:04 alostale New Issue
2017-06-19 15:04 alostale Assigned To => alostale
2017-06-19 15:04 alostale Modules => Core
2017-06-19 15:04 alostale Triggers an Emergency Pack => No
2017-06-19 15:04 alostale Tag Attached: Performance
2017-06-19 15:07 alostale Relationship added has duplicate 0023882
2017-06-19 15:10 alostale Relationship added related to 0036261
2017-06-19 15:17 hgbot Checkin
2017-06-19 15:17 hgbot Note Added: 0097478
2017-06-19 15:17 hgbot Status new => resolved
2017-06-19 15:17 hgbot Resolution open => fixed
2017-06-19 15:17 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cfd3f8102b4a1b9b3382a70128459cd258835ffa [^]
2017-06-20 09:23 alostale Review Assigned To => caristu
2017-06-20 16:31 hudsonbot Checkin
2017-06-20 16:31 hudsonbot Note Added: 0097518
2017-06-23 11:04 caristu Note Added: 0097602
2017-06-23 11:04 caristu Status resolved => closed
2017-06-23 11:04 caristu Fixed in Version => 3.0PR17Q3


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker