Openbravo Issue Tracking System - Retail Modules
View Issue Details
0051456Retail ModulesWeb POSpublic2023-01-25 21:142023-01-26 10:49
jetxarri 
Triage Platform Conn 
highmajoralways
closedinvalid 
5
 
 
No
0051456: When discounts engine is executed using Graal has secuencial behaviour
When discounts engine is executed using Graal has secuencial behaviour.

If the user makes 100 requests at a time the response is always secuencial:
-receive 100 request
-return 100 responses in a secuencial way

The problem of this behaviour is that one hundred request needs to wait the first 99 responses before it gets the 100 response.

The ideal behaviour will be:
-request 1
-request 2
-request 3
-response 1
-request 4
-response 3
-response 4
-response 2

We can see that the time between request and response is the time that the server takes to process the request.
-Do 100 request at a time to endpoint discounts.discounts

if you analyse the log you will see how the log
   Discount Engine initialized in {} ms

takes toons of time
The problem is happening in JAVA "GraalDiscountsExecutor". Exactly the problem comes in line
jsPath = getDiscountsJavaScript();

This method has a call to
discountsComponent.getStaticResourceFileName() + ".js";

Which contains a Syncrhonized tag.

Proposed solution:

@Inject
  protected ApplicationDictionaryCachedStructures adcs;

if (jsPath == null || adcs.isInDevelopment()){
  jsPath = getDiscountsJavaScript();
}
No tags attached.
Issue History
2023-01-25 21:14jetxarriNew Issue
2023-01-25 21:14jetxarriAssigned To => Retail
2023-01-25 21:14jetxarriTriggers an Emergency Pack => No
2023-01-26 08:00marvintmAssigned ToRetail => Triage Platform Conn
2023-01-26 08:01marvintmNote Added: 0145848
2023-01-26 10:49jetxarriNote Added: 0145860
2023-01-26 10:49jetxarriStatusnew => closed
2023-01-26 10:49jetxarriResolutionopen => invalid

Notes
(0145848)
marvintm   
2023-01-26 08:01   
I've reassigned it to platform, because this seems to be a problem with the JS resources caching.
(0145860)
jetxarri   
2023-01-26 10:49   
Finally the problem is not reproducible with modules in status "NOT IN DEVELOPMENT"