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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036001
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorhave not tried2017-05-15 23:022017-05-29 17:43
ReporteregoitzView Statuspublic 
Assigned Toalostale 
PriorityimmediateResolutionfixedFixed in Version3.0PR17Q3
StatusclosedFix in branchFixed in SCM revisioned6475ed00d3
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression levelPre packaging ( pi )
Regression date2017-04-27
Regression introduced in releasepi
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/275afe71cbfd4e1ddd7e1b04671559bd01614af2 [^]
Triggers an Emergency PackNo
Summary

0036001: Connection leak after start the system having any servlet with "loaded-on-startup" for example: Analytics module installed

DescriptionA transaction is not closed after restart tomcat when the instance has Analytics module installed.

The problem occurs for any Servlet that is marked to be loaded on startup, at this point a DAL connection is now created out of a Servlet request, so standard DalThreadHandler is not closing it.
Steps To ReproduceIn an environment with Analytics module installed:

1- Start tomcat

Check on the pg_stat_activity that there is a line in state='idle in transaction'

the query is:

SELECT mo.action AS TYPE, (CASE mo.action WHEN 'X' THEN mo.ad_form_id WHEN 'P' THEN mo.ad_process_id WHEN 'R' THEN mo.ad_process_id WHEN 'S' THEN mo.ad_reference_id WHEN 'C' THEN mo.ad_callout_id ELSE null END) AS ID, m.name AS NAME, /*Name is only maintained for backwards compatibility, now REPORT_TITLE is automatically filled*/ COALESCE((CASE mo.action WHEN 'X' THEN f.ad_module_id WHEN 'P' THEN p.ad_module_id WHEN 'R' THEN p.ad_module_id WHEN 'S' THEN r.ad_module_id W

Having Analytics installed this query is launched in the init method of the QueryRepositoryServlet servlet
Proposed SolutionBeing this query executed on Servlet's init method, which is typically executed just once per class, the overhead of using an extra connection for 1st execution is small. So reverting init part of changeset for 0035855 is safe in this case.
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0023882 closedalostale 2 dangling DB connections after Tomcat start 
caused by defect 0035855 closedalostale many standard requests borrow more than one connection from DB 

-  Notes
(0096612)
egoitz (developer)
2017-05-15 23:03

The query is located on the following file:

src/org/openbravo/base/secureApp/ClassInfo_data.xsql:
(0096666)
alostale (manager)
2017-05-19 08:35

Not reproducible with the reported steps, please provide more information to reproduce it.
(0096669)
caristu (developer)
2017-05-19 09:05

It seems that it can be reproduced always when the Analytics module is present.

Steps to reproduce updated.
(0096691)
hgbot (developer)
2017-05-22 10:55

Repository: erp/devel/pi
Changeset: ed6475ed00d30181c399db5aeccc3de6e34bb4f4
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon May 22 10:47:17 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ed6475ed00d30181c399db5aeccc3de6e34bb4f4 [^]

fixed bug 36001: leaked db connection after start the system having Analytics

  A DB transaction is kept open in 'idle in transaction' state forever afeter
  Tomcat start in case there are any servlet that is loaded on startup.

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---
(0096692)
hgbot (developer)
2017-05-22 10:55

Repository: erp/devel/pi
Changeset: fcdc5e67ecce0650b883d667cb0463f5834b217e
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon May 22 10:53:27 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fcdc5e67ecce0650b883d667cb0463f5834b217e [^]

related to bug 36001: HSAS.init log cleanup

  * Removed unneeded log for host info
  * Rephrased mehtod invokation message
  * Add context in case of error
  * Show stack traces in case of error

---
M src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
---
(0096774)
caristu (developer)
2017-05-25 09:20

Code reviewed + testing OK.
(0096977)
hudsonbot (developer)
2017-05-29 17:43

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/1ee70113bdc4 [^]
Maturity status: Test
(0096978)
hudsonbot (developer)
2017-05-29 17:43

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/1ee70113bdc4 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-05-15 23:02 egoitz New Issue
2017-05-15 23:02 egoitz Assigned To => platform
2017-05-15 23:02 egoitz Modules => Core
2017-05-15 23:02 egoitz Resolution time => 1496008800
2017-05-15 23:02 egoitz Triggers an Emergency Pack => No
2017-05-15 23:03 egoitz Note Added: 0096612
2017-05-19 08:06 caristu Relationship added related to 0023882
2017-05-19 08:35 alostale Note Added: 0096666
2017-05-19 08:35 alostale Assigned To platform => egoitz
2017-05-19 08:35 alostale Status new => feedback
2017-05-19 08:36 alostale Tag Attached: Performance
2017-05-19 08:46 caristu Relationship added caused by 0035855
2017-05-19 09:04 caristu Regression level => Pre packaging ( pi )
2017-05-19 09:04 caristu Regression date => 2017-04-27
2017-05-19 09:04 caristu Regression introduced in release => pi
2017-05-19 09:04 caristu Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/275afe71cbfd4e1ddd7e1b04671559bd01614af2 [^]
2017-05-19 09:04 caristu Status feedback => new
2017-05-19 09:04 caristu Summary Connection leak after restart and login to the system => Connection leak after restart and login to the system having Analytics module installed
2017-05-19 09:04 caristu Description Updated View Revisions
2017-05-19 09:04 caristu Steps to Reproduce Updated View Revisions
2017-05-19 09:05 caristu Note Added: 0096669
2017-05-19 13:22 caristu Assigned To egoitz => platform
2017-05-22 08:35 alostale Priority normal => immediate
2017-05-22 10:32 alostale Summary Connection leak after restart and login to the system having Analytics module installed => Connection leak after start the system having Analytics module installed
2017-05-22 10:32 alostale Description Updated View Revisions
2017-05-22 10:32 alostale Proposed Solution updated
2017-05-22 10:54 alostale Assigned To platform => alostale
2017-05-22 10:54 alostale Review Assigned To => caristu
2017-05-22 10:55 hgbot Checkin
2017-05-22 10:55 hgbot Note Added: 0096691
2017-05-22 10:55 hgbot Status new => resolved
2017-05-22 10:55 hgbot Resolution open => fixed
2017-05-22 10:55 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ed6475ed00d30181c399db5aeccc3de6e34bb4f4 [^]
2017-05-22 10:55 hgbot Checkin
2017-05-22 10:55 hgbot Note Added: 0096692
2017-05-25 09:20 caristu Note Added: 0096774
2017-05-25 09:20 caristu Status resolved => closed
2017-05-25 09:20 caristu Fixed in Version => 3.0PR17Q3
2017-05-29 12:48 shuehner Summary Connection leak after start the system having Analytics module installed => Connection leak after start the system having any servlet with "loaded-on-startup" for example: Analytics module installed
2017-05-29 17:43 hudsonbot Checkin
2017-05-29 17:43 hudsonbot Note Added: 0096977
2017-05-29 17:43 hudsonbot Checkin
2017-05-29 17:43 hudsonbot Note Added: 0096978


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker