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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037277
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 01. General setupmajorhave not tried2017-11-13 10:092018-01-03 12:39
ReporterSandrahuguetView Statuspublic 
Assigned ToAtulOpenbravo 
PrioritynormalResolutionfixedFixed in Version3.0PR18Q1
StatusclosedFix in branchFixed in SCM revision1f0a3515e2b9
ProjectionnoneETAnoneTarget Version
OSLinux 64 bitDatabasePostgreSQLJava version7.x
OS VersionOpenbravo Appliance 14.04Database version9.3.xAnt version1.9.x
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037277: Change the role in the ERP has performance problems

DescriptionIn an environment with many organizations, get General Ledger of context organizations part in LoginUtils.java (specifically, the loop by organization and selectAcctSchema inside) is very slow (takes around 17s).

slow part:

        // Get General Ledger of context organizations
        if (ArrayUtils.isEmpty(attr)) {
          String[] orgList = Utility.getContext(conn, vars, "#User_Org", "LoginHandler")
              .replace("'", "").split(",");
          for (String orgId : orgList) {
            if (!StringUtils.equals(orgId, strOrg)) {
              acctSchemaId = OBLedgerUtils.getOrgLedger(orgId);
              if (StringUtils.isNotEmpty(acctSchemaId)) {
                attr = AttributeData.selectAcctSchema(conn, acctSchemaId,
                    Utility.getContext(conn, vars, "#User_Client", "LoginHandler"));
                if (ArrayUtils.isNotEmpty(attr)) {
                  break;
                }
              }
            }
          }
        }
Steps To ReproduceLogin in the ERP
Open developer tools
Change the role to a role with access to many organizations
Notice that UserInfoWidgetActionHandler request takes around 18s
TagsPerformance
Attached Files? file icon createOrg.sql [^] (2,297 bytes) 2017-11-27 06:54
diff file icon issue-37277.diff [^] (1,102 bytes) 2017-11-30 18:23 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0036638 newTriage Platform Base DalConnectionProvider(true) or () in combination with standard xsql causes 1 flush per SQL 
depends on backport 00374563.0PR17Q4 closedAtulOpenbravo Change the role in the ERP has performance problems 
depends on backport 00374573.0PR17Q3.2 closedAtulOpenbravo Change the role in the ERP has performance problems 
related to defect 0037455 scheduledAtulOpenbravo Detected slow piece of code in LoginUtils 

-  Notes
(0100719)
AtulOpenbravo (developer)
2017-11-27 06:53

Test Plan A

- Create organization using attached createOrg script.
- In LoginUtils add time log statement for the loop in the issue.
- Login as F&B International Group admin.
- Switch role to System Admin
- Set session preferences using Change Logs for LoginUtils class as DEBUG
- Switch role to F&B international Group Admin
- Check in logged timings. It is around ~ 300+ ms

Apply the fix for issue. Flow above steps of enabling preferences and switching the role.
- Check the logged timings. It is around 1 to 4 ms


Test Plan B

- Create General Ledger Configuration records as below
 - 001 Test Ledger 37277. Assign this F&B Espana Norte Region
 - 002 Test Ledger 37277. Assign this F&B Espana Sur Region
 - 003 Test Ledger 37277. Assign this F&B Espana
- Make sure that all ledgers does not have any dimension active.
- Realize/Set F&B International Group organization with General Ledger as "F&B International Group US/A/US Dollar"
- Realize/Set that above "F&B International Group US/A/US Dollar" general ledger has active elements.
- Create a new role "001 Test Role 32277" with organization access to only "F&B Espana Norte Region"
- Assign User Openbravo to it. Add Business Partner window in Window Access Tab
- Logout and Login again with Openbravo User.
- Switch Role to "001 Test Role 32277".
- Realize that General Ledger for F&B International Group is choosed for attr
   as it is in parent list of "F&B Espana Norte Region" and has active elements.
(0100815)
AtulOpenbravo (developer)
2017-11-29 22:37

Test Plan C

- Login as F&B International Group Admin.
- In General Ledger configuration, make sure that both the general ledgers should have not any active elements in Dimension tab.
- Create a new General Ledger and create at least one active element in dimension tab.
- Try switching role from F&B International Group Admin to System Admin and again back to F&B International Group Admin
- Realize that new general ledger having active elements should be considered by the loop which gets general ledger from context orgs.
(0100893)
AtulOpenbravo (developer)
2017-12-01 12:53
edited on: 2017-12-01 12:54

Time logs before fix, when switching from System Admin to BUT Admin role

Code Level :Loop which traverses through organization list takes

            Run#1. 14820 ms
            Run#2. 14756 ms
            Run#3. 14487 ms
 
UI Level : 20-23 seconds

After the fix

Code Level
           Run#1. 1 ms
           Run#2. 1 ms
           Run#3. 1 ms

UI Level : 8-9 seconds

(0100974)
AtulOpenbravo (developer)
2017-12-12 10:19

Time logs in local instance with similar setup as in client environment

500+ organizations with General Ledger having no dimensions or no active dimensions defined.

Before any Fix
At first login
Time taken to fetch general ledger of context org (ms):- 426
Time taken to fetch general ledger of context org (ms):- 464

Changing role from System Admin to Client Admin
Run#1
Time taken to fetch general ledger of context org (ms):- 7587
Run#2
Time taken to fetch general ledger of context org (ms):- 7191
Run#3
Time taken to fetch general ledger of context org (ms):- 7134
Run#4
Time taken to fetch general ledger of context org (ms):- 6800

GUI: ~ 8.5 to 9 seconds

After Fix issue-37277.diff
At first login
Time taken to fetch general ledger of context org (ms):- 448
Time taken to fetch general ledger of context org (ms):- 537
Changing role from System Admin to Client Admin

Run#1
Time taken to fetch general ledger of context org (ms):- 215 Org count visited..541
Run#2
Time taken to fetch general ledger of context org (ms):- 196 Org count visited..541
Run#3
Time taken to fetch general ledger of context org (ms):- 213 Org count visited..541
Run#4
Time taken to fetch general ledger of context org (ms):- 153 Org count visited..541

GUI: ~ 2.5 to 3 seconds


With both the fixes
At first login
Total Time (ms): General Ledger of context organizations: 110

Changing role from System Admin to Client Admin
Run#1
Total Time (ms): General Ledger of context organizations: 97
Run#2
Total Time (ms): General Ledger of context organizations: 73
Run#3
Total Time (ms): General Ledger of context organizations: 55
Run#4
Total Time (ms): General Ledger of context organizations: 54

GUI: ~ 2 to 2.5 seconds
(0100982)
hgbot (developer)
2017-12-12 12:09

Repository: erp/devel/pi
Changeset: 1f0a3515e2b9bfe2b894e7f40ef07f4930118d8d
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Dec 12 14:56:33 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/1f0a3515e2b9bfe2b894e7f40ef07f4930118d8d [^]

Fixes Issue 37277:Change the role in the ERP has performance
problems

** Flush is called before calling fillSessionArguments
** new ConnectionProvider without flush is passed to the
fillSessionArguments method which avoids flush for
every select statement which uses this connection Provider
as flush is not need for select statements.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/UserInfoWidgetActionHandler.java
---
(0101519)
hudsonbot (developer)
2018-01-03 12:39

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

- Issue History
Date Modified Username Field Change
2017-11-13 10:09 Sandrahuguet New Issue
2017-11-13 10:09 Sandrahuguet Assigned To => Triage Finance
2017-11-13 10:09 Sandrahuguet Modules => Core
2017-11-13 10:09 Sandrahuguet Triggers an Emergency Pack => No
2017-11-13 10:10 Sandrahuguet Tag Attached: Performance
2017-11-13 10:18 Sandrahuguet Resolution time => 1512342000
2017-11-13 10:20 Sandrahuguet Description Updated View Revisions
2017-11-13 10:23 Sandrahuguet Description Updated View Revisions
2017-11-13 11:14 Sandrahuguet Description Updated View Revisions
2017-11-13 18:11 dmiguelez Assigned To Triage Finance => collazoandy4
2017-11-14 12:52 dmiguelez Assigned To collazoandy4 => AtulOpenbravo
2017-11-21 15:33 AtulOpenbravo Status new => scheduled
2017-11-27 06:53 AtulOpenbravo Note Added: 0100719
2017-11-27 06:54 AtulOpenbravo File Added: createOrg.sql
2017-11-29 22:37 AtulOpenbravo Note Added: 0100815
2017-11-30 18:23 shuehner File Added: issue-37277.diff
2017-11-30 18:23 shuehner Relationship added related to 0036638
2017-12-01 12:53 AtulOpenbravo Note Added: 0100893
2017-12-01 12:54 AtulOpenbravo Note Edited: 0100893 View Revisions
2017-12-12 10:15 AtulOpenbravo Issue cloned 0037455
2017-12-12 10:15 AtulOpenbravo Relationship added related to 0037455
2017-12-12 10:16 AtulOpenbravo Status scheduled => acknowledged
2017-12-12 10:17 AtulOpenbravo Status acknowledged => scheduled
2017-12-12 10:19 AtulOpenbravo Note Added: 0100974
2017-12-12 12:09 hgbot Checkin
2017-12-12 12:09 hgbot Note Added: 0100982
2017-12-12 12:09 hgbot Status scheduled => resolved
2017-12-12 12:09 hgbot Resolution open => fixed
2017-12-12 12:09 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1f0a3515e2b9bfe2b894e7f40ef07f4930118d8d [^]
2017-12-12 12:11 vmromanos Review Assigned To => vmromanos
2017-12-12 12:11 vmromanos Status resolved => closed
2017-12-12 12:11 vmromanos Fixed in Version => 3.0PR18Q1
2017-12-14 12:17 vmromanos Severity major => minor
2017-12-14 12:17 vmromanos Summary Change the role in the ERP has performance problems => Detected slow piece of code in LoginUtils
2017-12-14 12:17 vmromanos Description Updated View Revisions
2017-12-14 12:17 vmromanos Steps to Reproduce Updated View Revisions
2017-12-14 12:18 vmromanos Severity minor => major
2017-12-14 12:18 vmromanos Description Updated View Revisions
2017-12-14 12:18 vmromanos Steps to Reproduce Updated View Revisions
2017-12-14 12:20 vmromanos Summary Detected slow piece of code in LoginUtils => Change the role in the ERP has performance problems
2018-01-03 12:39 hudsonbot Checkin
2018-01-03 12:39 hudsonbot Note Added: 0101519


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker