Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0053423Openbravo ERPA. Platformpublic2023-09-08 13:032023-09-13 10:11
alostale 
alostale 
normalmajorrandom
closedfixed 
5
 
PR23Q4 
Core
No
0053423: cannot open any BO windows
Under certain circumstances, if a given race condition occurs, it is possible that no BO window can be opened.

Workaround: This race condition occurs during initialization, and gets cached. So if it occurs, it will continue in this incorrect status until Tomcat is restarted.

The problem is in BaseComponent.getContextUrl[1] method, that can be invoked concurrently although it sets and mutates an static shared variable. If there are two concurrent requests accessing this method one of them could return a corrupted value, if the one that received the corrupted value was serving the application component, which is later part of generated js file and therefore cached, this value will be incorrect causing failures when composing the url to retrieve views.


[1] https://gitlab.com/openbravo/product/openbravo/-/blob/release/23Q3/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java?ref_type=heads#L90 [^]
 
It occurs very rarely:

1. Restart Tomcat
2. Open several BO applications at the same time
3. Try to open any window:
   ERROR
     * it keeps in loading forever
     * http request to generate its view results in a 404 because the url is incorrectly built
No tags attached.
Issue History
2023-09-08 13:03alostaleNew Issue
2023-09-08 13:03alostaleAssigned To => Triage Platform Base
2023-09-08 13:03alostaleModules => Core
2023-09-08 13:03alostaleTriggers an Emergency Pack => No
2023-09-08 13:03alostaleAssigned ToTriage Platform Base => alostale
2023-09-08 13:17hgbotNote Added: 0154636
2023-09-13 08:21hgbotNote Added: 0154760
2023-09-13 09:22hgbotNote Added: 0154763
2023-09-13 09:22hgbotNote Added: 0154764
2023-09-13 09:22hgbotNote Added: 0154765
2023-09-13 09:22hgbotResolutionopen => fixed
2023-09-13 09:22hgbotStatusnew => closed
2023-09-13 09:22hgbotFixed in Version => PR23Q4
2023-09-13 09:22hgbotNote Added: 0154766
2023-09-13 10:11hgbotNote Added: 0154768

Notes
(0154636)
hgbot   
2023-09-08 13:17   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/992 [^]
(0154760)
hgbot   
2023-09-13 08:21   
Merge Request created: https://gitlab.com/openbravo/ci/backoffice-api/-/merge_requests/49 [^]
(0154763)
hgbot   
2023-09-13 09:22   
Repository: https://gitlab.com/openbravo/ci/backoffice-api [^]
Changeset: 37d0afb4f28404b9094a9fb1cd2d05166aff16f5
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 13-09-2023 08:19:23
URL: https://gitlab.com/openbravo/ci/backoffice-api/-/commit/37d0afb4f28404b9094a9fb1cd2d05166aff16f5 [^]

related to BUG-53423: API change: BaseComponent.setContextUrl is private static

---
M java/reference/java.japi.gz
---
(0154764)
hgbot   
2023-09-13 09:22   
Merge request merged: https://gitlab.com/openbravo/ci/backoffice-api/-/merge_requests/49 [^]
(0154765)
hgbot   
2023-09-13 09:22   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/992 [^]
(0154766)
hgbot   
2023-09-13 09:22   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 291e8810367f91ddee726efada674f7e3bf674e0
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 13-09-2023 08:13:56
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/291e8810367f91ddee726efada674f7e3bf674e0 [^]

fixes BUG-53423: cannot open any BO window due to incorrect ctx initialization

BaseComponent.getContextUrl method can be concurrently invoked, as it mutated a
static contextUrl variable it could be served in a corrupted (partial) state. If
this occurred while generating application component, no view could later be
opened.

This fix includes:
  * Transformations on contextUrl variable are done in a temporary variable, to
    be cached only when completelly computed.
  * It is set in a synchronized method: although this has no real effect, it
    makes it more explicit.

In addition:
  * contextUrl private variable is only exposed through its getter, its contents
    were not directly got but transformed every time. Now this transformation is
    also persisted so it is executed only once.
  * setContextUrl method is now private as it was not publicly used.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseComponent.java
---
(0154768)
hgbot   
2023-09-13 10:11   
Repository: https://gitlab.com/openbravo/ci/mobile-api [^]
Changeset: 0f4cec5fe1f6aa38edf2270c6ee1c9cdebb5813c
Author: Carlos Aristu <carlos.aristu@openbravo.com>
Date: 13-09-2023 10:11:27
URL: https://gitlab.com/openbravo/ci/mobile-api/-/commit/0f4cec5fe1f6aa38edf2270c6ee1c9cdebb5813c [^]

related to BUG-53423: API change: BaseComponent.setContextUrl is private static

---
M java/reference/java.japi.gz
---