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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0030174
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POScriticalhave not tried2015-06-13 13:302015-06-29 09:36
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionfixedFixed in VersionRR15Q3
StatusclosedFix in branchFixed in SCM revision276b29d81030
ProjectionnoneETAnoneTarget VersionRR15Q3
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0030174: Triggers temporarily disabled for whole application through webpos

DescriptionWhen running webpos in a high load environment it shows that sometimes triggers are enabled in the middle of the cashup backend code, causing the code to fail (see attached stack trace for an example).

What causes this is that the triggers disabled record in AD_SESSION_STATUS gets committed and is visible for other connections, these connections/threads also enable triggers after their work, effectively deleting the AD_SESSION_STATUS record, this again results in the original thread having triggers enabled during processing.

Exact flow:
Thread 1: does cashup by first disabling triggers and creating AD_SESSION_STATUS record, this record should only be visible to thread 1 as the insert should not be committed. But it is...
Thread 1: calls ordergrouping processor which does commit, now everyone sees the new AD_SESSION_STATUS record
Thread 2: was already doing work, disabling triggers in his own connection, and then enabling them again, this removes all AD_SESSION_STATUS records visible to the connection of thread 2, this now also includes the AD_SESSION_STATUS record created for thread 1, so AD_SESSION_STATUS for thread 1 also gets deleted.
Thread 1: tries to do its remaining work but gets an error because triggers are suddenly enabled again because thread 2 deleted it AD_SESSION_STATUS record.


Caused by this change:
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4685#l1.361 [^]
Steps To ReproduceRun stress test simulate business day with 2 nodes and 5 clients each. One run will result in several errors in OBPOS import errors
Proposed SolutionReplace this line:
https://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4685#l1.361 [^]

with OBDal.getInstance().flush()

Also add a check to the SessionHandler commit code to not allow commits when triggers are enabled.
TagsNo tags attached.
Attached Filestxt file icon stack.txt [^] (7,454 bytes) 2015-06-13 13:30 [Show Content]
diff file icon check_triggers_disabled.diff [^] (1,075 bytes) 2015-06-13 13:31 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
caused by defect 0029774RR15Q3 closedmalsasua Retail Modules [cashup refactor] improve the performance of cashup 
related to design defect 0029611 acknowledgedTriage Platform Base Openbravo ERP The way we disable triggers with TriggerHandler may lead to leaving the triggers disabled indefinitly 

-  Notes
(0078264)
hgbot (developer)
2015-06-13 17:10

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 276b29d81030bb2fa50fabf08ee4470a51d8bc17
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Jun 13 13:42:17 2015 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/276b29d81030bb2fa50fabf08ee4470a51d8bc17 [^]

Fixes issue 30174: Triggers temporarily disabled for whole application through webpos
Replace commit and close with flush

---
M src/org/openbravo/retail/posterminal/OrderGroupingProcessor.java
---
(0078289)
hgbot (developer)
2015-06-15 10:44

Repository: erp/devel/pi
Changeset: 98cb1ce1537dadf935205bb3b84f4457d7da7d29
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Mon Jun 15 08:45:40 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/98cb1ce1537dadf935205bb3b84f4457d7da7d29 [^]

Related to issue 30174: Triggers temporarily disabled for whole application through webpos
Added check/test code in OBDal to prevent disabling triggers 'globally'

---
M src/org/openbravo/dal/core/SessionHandler.java
---
(0078309)
hudsonbot (developer)
2015-06-16 00:37

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

- Issue History
Date Modified Username Field Change
2015-06-13 13:30 mtaal New Issue
2015-06-13 13:30 mtaal Assigned To => mtaal
2015-06-13 13:30 mtaal File Added: stack.txt
2015-06-13 13:30 mtaal Triggers an Emergency Pack => No
2015-06-13 13:31 mtaal File Added: check_triggers_disabled.diff
2015-06-13 17:10 hgbot Checkin
2015-06-13 17:10 hgbot Note Added: 0078264
2015-06-13 17:10 hgbot Status new => resolved
2015-06-13 17:10 hgbot Resolution open => fixed
2015-06-13 17:10 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/276b29d81030bb2fa50fabf08ee4470a51d8bc17 [^]
2015-06-15 08:26 alostale Relationship added caused by 0029774
2015-06-15 10:44 hgbot Checkin
2015-06-15 10:44 hgbot Note Added: 0078289
2015-06-16 00:37 hudsonbot Checkin
2015-06-16 00:37 hudsonbot Note Added: 0078309
2015-06-29 09:36 marvintm Review Assigned To => marvintm
2015-06-29 09:36 marvintm Status resolved => closed
2015-06-29 09:36 marvintm Fixed in Version => RR15Q3
2016-01-26 09:56 AugustoMauch Relationship added related to 0029611


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker