Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035482Retail ModulesStoreServerpublic2017-03-10 14:232017-03-27 09:51
mtaal 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
RR17Q2 
AugustoMauch
No
0035482: MobileMainServerCheck should also use last ping approach
The MobileMainServerCheck [1] class starts pinging the central server when it is offline. This can overflow the central server when it gets back online (all store servers ping it then). Therefore the idea is to let the MobileMainServerCheck also use the lastping approach. It continuously checks if a last ping was received from the main server.

Also the MobileServerStatusInformation [2] should have some code to check that it is only called on the store server, so it should not be called/executed on the central server, it should be called from the central server.

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/9df8c77e1fd8/src/org/openbravo/mobile/core/servercontroller/MobileMainServerCheck.java [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/9df8c77e1fd8/src/org/openbravo/mobile/core/servercontroller/MobileServerStatusInformation.java#l37 [^]
See description
Use last ping approach also in case of mobile main server check

Add log/warn statement if mobile server status webservice is called on the central server
No tags attached.
related to defect 0035113 closed mtaal The ServerStateBackground server ping unregistered servers 
Issue History
2017-03-10 14:23mtaalNew Issue
2017-03-10 14:23mtaalAssigned To => mtaal
2017-03-10 14:23mtaalTriggers an Emergency Pack => No
2017-03-10 14:23mtaalRelationship addedrelated to 0035113
2017-03-10 14:24mtaalRelationship deletedrelated to 0035113
2017-03-10 14:29mtaalSummaryAdd check/log in MobileServerStatusInformation so that it is only called by central on store => MobileMainServerCheck should also use last ping approach
2017-03-10 14:29mtaalDescription Updatedbug_revision_view_page.php?rev_id=14769#r14769
2017-03-10 14:29mtaalProposed Solution updated
2017-03-10 14:29mtaalRelationship addedrelated to 0035113
2017-03-13 10:49AugustoMauchAssigned Tomtaal => AugustoMauch
2017-03-15 13:16hgbotCheckin
2017-03-15 13:16hgbotNote Added: 0095030
2017-03-15 13:16hgbotStatusnew => resolved
2017-03-15 13:16hgbotResolutionopen => fixed
2017-03-15 13:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/388cb7e16a014ee77632ca4aaea27cea1b657909 [^]
2017-03-15 13:17AugustoMauchReview Assigned To => mtaal
2017-03-19 10:25mtaalNote Added: 0095391
2017-03-19 10:35mtaalReview Assigned Tomtaal => AugustoMauch
2017-03-19 10:41hgbotCheckin
2017-03-19 10:41hgbotNote Added: 0095395
2017-03-19 10:41hgbotCheckin
2017-03-19 10:41hgbotNote Added: 0095398
2017-03-19 10:41hgbotCheckin
2017-03-19 10:41hgbotNote Added: 0095399
2017-03-27 09:51AugustoMauchNote Added: 0095583
2017-03-27 09:51AugustoMauchStatusresolved => closed

Notes
(0095030)
hgbot   
2017-03-15 13:16   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 388cb7e16a014ee77632ca4aaea27cea1b657909
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Mar 15 13:13:19 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/388cb7e16a014ee77632ca4aaea27cea1b657909 [^]

Fixes issue 35482: Refactors, improves performance of MobileMainServerCheck

The following changes have been made to MobileMainServerCheck:
- Store servers no longer ping the central server. They just check when was the last time the central server pinged them to determine if the central server is offline.
- Once a store server is determined to be offline, the MobileMainServerCheck is terminated.

Some methods from ServerStateBackground have been made static and public to be reused from MobileMainServerCheck.

---
M src/org/openbravo/mobile/core/servercontroller/MobileMainServerCheck.java
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
---
(0095391)
mtaal   
2017-03-19 10:25   
Reviewed, will do additional commits, will be reviewed by original committer
(0095395)
hgbot   
2017-03-19 10:41   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 47961a4afa40e5a26774bfa89a39234f2a1cd67f
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Mar 19 10:27:07 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/47961a4afa40e5a26774bfa89a39234f2a1cd67f [^]

Related to issue 35482: MobileMainServerCheck should also use last ping approach
Make sure that the transition to offline logic is started (and if not restart it) in case of transitioning to offline.
Do the correct check against the value of the enum, instead of the enum itself and also use the correct OFFLINE enum

---
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
---
(0095398)
hgbot   
2017-03-19 10:41   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 377ca2a412362d05bf09afa59a94c349e2579256
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Mar 19 10:38:35 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/377ca2a412362d05bf09afa59a94c349e2579256 [^]

Related to issue 35482: MobileMainServerCheck should also use last ping approach
Added a comment for clarification

---
M src/org/openbravo/mobile/core/servercontroller/MobileMainServerCheck.java
---
(0095399)
hgbot   
2017-03-19 10:41   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 4baeb6c30f004b0e97bd23241c008caefefd49b4
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Mar 19 10:39:18 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/4baeb6c30f004b0e97bd23241c008caefefd49b4 [^]

Related to issue 35482: MobileMainServerCheck should also use last ping approach
Corrected wrong log statement text

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerController.java
---
(0095583)
AugustoMauch   
2017-03-27 09:51   
Code reviewed and verified