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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0043440
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2020-03-05 19:162023-12-11 23:24
ReporterioritzCiaView Statuspublic 
Assigned ToioritzCia 
PriorityhighResolutionout of dateFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSLinux 64 bitDatabasePostgreSQLJava version8
OS VersionUbuntu 18.04Database version11Ant version1.9
Product VersionSCM revision 
Review Assigned Todmitry_mezentsev
Web browserGoogle Chrome
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0043440: [Performance] With an certain code in evenhandlers it is possible to leave non reusable connections in the pool

DescriptionWith an certain code in evenhandlers it is possible to leave non reusable connections in the pool.

Code must be improved in the eventhandlers, but some changes are required in platform as well.
Steps To Reproduce- In tomcat conf in server.xml file un comment line:
        <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
               maxThreads="150" minSpareThreads="4"/>
  and put maxThreads="5"
- In an environment with retail apply the attached patch
- Log in the system with a user and go to User -> User roles and activate and deactivate some user roles
- Open, refresh and close windows
- Log out and log in with another user
- Do the same
- Wait more than two minutes
- Go to the database and execute 'select * from pg_stat_activity order by xact_start;'
- There are connections with state_change older than 2 minutes that the pool should have closed (because of the default db.pool.minEvictableIdleTimeMillis=120000 configuration in Openbravo.properties)
TagsPerformance
Attached Filesdiff file icon UserRoleEventHandler.diff [^] (5,913 bytes) 2020-03-05 19:16 [Show Content]
diff file icon UserRoleEventHandlerv2.diff [^] (5,958 bytes) 2020-03-13 10:57 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0118582)
caristu (developer)
2020-03-13 11:01
edited on: 2020-03-13 11:03

It seems that the problem of the connections not being evicted is because a bad management of the ThreadLocal variable used by the event handler. The ThreadLocal is currently keeping in memory the reference to the hibernate Transaction and it is never being cleanup once it is no longer needed. Somehow this is not allowing the pool to close the idle connections that it should close to reach the configured limit.

To confirm this, we have modified the provided event handler (UserRoleEventHandlerv2.diff) but we are forcing the cleanup of the ThreadLocal variable.

Put this issue in feedback status, waiting for confirmation that with this change the problem can't be reproduced.

(0158061)
dmitry_mezentsev (developer)
2023-12-11 23:24

Too long in feedback

- Issue History
Date Modified Username Field Change
2020-03-05 19:16 ioritzCia New Issue
2020-03-05 19:16 ioritzCia Assigned To => platform
2020-03-05 19:16 ioritzCia File Added: UserRoleEventHandler.diff
2020-03-05 19:16 ioritzCia Web browser => Google Chrome
2020-03-05 19:16 ioritzCia Modules => Core
2020-03-05 19:16 ioritzCia Resolution time => 1584572400
2020-03-05 19:16 ioritzCia Triggers an Emergency Pack => No
2020-03-05 19:17 ioritzCia Tag Attached: Performance
2020-03-05 19:22 ioritzCia Web browser Google Chrome => Google Chrome
2020-03-05 19:22 ioritzCia Steps to Reproduce Updated View Revisions
2020-03-13 10:57 caristu File Added: UserRoleEventHandlerv2.diff
2020-03-13 11:01 caristu Note Added: 0118582
2020-03-13 11:01 caristu Assigned To platform => ioritzCia
2020-03-13 11:01 caristu Status new => feedback
2020-03-13 11:03 caristu Note Edited: 0118582 View Revisions
2020-03-13 11:04 caristu Web browser Google Chrome => Google Chrome
2020-03-13 11:04 caristu Steps to Reproduce Updated View Revisions
2023-12-11 23:24 dmitry_mezentsev Review Assigned To => dmitry_mezentsev
2023-12-11 23:24 dmitry_mezentsev Note Added: 0158061
2023-12-11 23:24 dmitry_mezentsev Status feedback => closed
2023-12-11 23:24 dmitry_mezentsev Resolution open => out of date


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker