Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038505Retail ModulesStoreServerpublic2018-05-08 22:512018-05-31 12:41
mtaal 
AugustoMauch 
normalmajorhave not tried
closedfixed 
5
 
 
mtaal
No
0038505: Before going offline do extra ping request
Currently the ss goes offline if a request fails three times to the CS. However, this can be too pessimistic as an error in one specific service can cause the ss to go offline.

The proposal is therefore to do a separate ping request to the CS to check if the CS is indeed not-reachable. This separate ping request to CS should do some simple and meaningful checks on the CS. For example a db query.
See the code here [1] for example, this forces offline after three failures.

Check all calls to MobileServerController.transitionToOffline

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/tip/src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java#l228 [^]
Probably the best place to do the offline transition ping request is in the transitionToOffline method in the MobileServiceController [2]

Note: if the ping request makes use of the MobileServiceRequestExecutor then cyclic call stacks/infinite loops must be prevented.

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/file/tip/src/org/openbravo/mobile/core/servercontroller/MobileServerController.java#l474 [^]
No tags attached.
has duplicate defect 0038497 closed StoreServer If the store server receives a response from the central server with bad JSON format, it should not go offline 
related to defect 0038935 closed AugustoMauch Wrong check leads to infinite loop,which results in many requests being done from store to central server 
Issue History
2018-05-08 22:51mtaalNew Issue
2018-05-08 22:51mtaalAssigned To => AugustoMauch
2018-05-08 22:51mtaalTriggers an Emergency Pack => No
2018-05-10 17:13AugustoMauchRelationship addedhas duplicate 0038497
2018-05-14 09:46rafademiguelIssue Monitored: rafademiguel
2018-05-15 09:48hgbotCheckin
2018-05-15 09:48hgbotNote Added: 0104513
2018-05-15 09:48hgbotCheckin
2018-05-15 09:48hgbotNote Added: 0104514
2018-05-15 09:49hgbotCheckin
2018-05-15 09:49hgbotNote Added: 0104515
2018-05-15 09:49hgbotCheckin
2018-05-15 09:49hgbotNote Added: 0104516
2018-05-15 09:52hgbotCheckin
2018-05-15 09:52hgbotNote Added: 0104517
2018-05-15 10:27AugustoMauchStatusnew => scheduled
2018-05-15 10:27AugustoMauchFixed in SCM revision => https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3a813c770f76a3dbc12693096521537e82d08532 [^]
2018-05-15 10:27AugustoMauchStatusscheduled => resolved
2018-05-15 10:27AugustoMauchResolutionopen => fixed
2018-05-15 16:25AugustoMauchReview Assigned To => mtaal
2018-05-16 08:43hgbotCheckin
2018-05-16 08:43hgbotNote Added: 0104537
2018-05-19 13:18mtaalNote Added: 0104593
2018-05-26 14:05hgbotCheckin
2018-05-26 14:05hgbotNote Added: 0104724
2018-05-28 00:07mtaalNote Added: 0104729
2018-05-28 00:07mtaalStatusresolved => new
2018-05-28 00:07mtaalResolutionfixed => open
2018-05-28 16:57hgbotCheckin
2018-05-28 16:57hgbotNote Added: 0104754
2018-05-28 16:57hgbotStatusnew => resolved
2018-05-28 16:57hgbotResolutionopen => fixed
2018-05-28 16:57hgbotFixed in SCM revisionhttps://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3a813c770f76a3dbc12693096521537e82d08532 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3f7ee63a1a714d4dc5ee30891f82c9dd7ca8fbde [^]
2018-05-30 21:00mtaalNote Added: 0104822
2018-05-30 21:00mtaalStatusresolved => new
2018-05-30 21:00mtaalResolutionfixed => open
2018-05-31 08:30hgbotCheckin
2018-05-31 08:30hgbotNote Added: 0104823
2018-05-31 08:35AugustoMauchStatusnew => scheduled
2018-05-31 08:35AugustoMauchStatusscheduled => resolved
2018-05-31 08:35AugustoMauchResolutionopen => fixed
2018-05-31 12:41mtaalNote Added: 0104839
2018-05-31 12:41mtaalNote Added: 0104840
2018-05-31 12:41mtaalStatusresolved => closed
2018-07-11 17:57AugustoMauchRelationship addedrelated to 0038935

Notes
(0104513)
hgbot   
2018-05-15 09:48   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: a5b03e4694a90ebabad4e10736a9b45eef8c00ad
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed May 09 17:35:19 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/a5b03e4694a90ebabad4e10736a9b45eef8c00ad [^]

Related with issue 38505: Fixes java format

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java
---
(0104514)
hgbot   
2018-05-15 09:48   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 5514ff8de2d94e6986971eb769fd0f5dc3071fdd
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed May 09 17:37:55 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/5514ff8de2d94e6986971eb769fd0f5dc3071fdd [^]

Related with issue 38505: Dont go offline if central server answers to request

Dont go offline even if the central server includes in its response a status different than ONLINE.

Central servers do not transition to offline, and if they are not reachable the store server will
transition to offline using another flow.

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java
---
(0104515)
hgbot   
2018-05-15 09:49   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 3a813c770f76a3dbc12693096521537e82d08532
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 10 15:45:41 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3a813c770f76a3dbc12693096521537e82d08532 [^]

Related with issue 38505: Do extra ping if central server does not respond

If the central server responds to the ping, do not go offline

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java
A src/org/openbravo/mobile/core/servercontroller/CheckServerAvailability.java
---
(0104516)
hgbot   
2018-05-15 09:49   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 2098bb2f8fc85e58ae1f19b0a94109ec581bc40e
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 10 16:40:41 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2098bb2f8fc85e58ae1f19b0a94109ec581bc40e [^]

Related with issue 38505: Pick the proper organization

---
M src/org/openbravo/mobile/core/servercontroller/CheckServerAvailability.java
---
(0104517)
hgbot   
2018-05-15 09:52   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 1ff84248a0c239f78c3d13ecff746b208d45da67
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 10 15:46:56 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/1ff84248a0c239f78c3d13ecff746b208d45da67 [^]

Related with issue 38505: Dont go offline in RetailSynchronizationRequestHandler

The logic to decide whether the store server should go offline after a failed request to the central
server is not placed in mobile.core.

---
M src/org/openbravo/retail/storeserver/synchronization/RetailSynchronizationRequestHandler.java
---
(0104537)
hgbot   
2018-05-16 08:43   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 8d5cb7cfb649393de1b24d0c5527f072dca583ef
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed May 16 08:43:20 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/8d5cb7cfb649393de1b24d0c5527f072dca583ef [^]

Related with issue 38505: Fixes eclipse warning

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java
---
(0104593)
mtaal   
2018-05-19 13:18   
Review questions:
- question, why was the readtimeout logic removed?
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3a813c770f76a3dbc12693096521537e82d08532#l2.43 [^]

- maybe change this to catch Throwable:
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3a813c770f76a3dbc12693096521537e82d08532#l2.76 [^]
(0104724)
hgbot   
2018-05-26 14:05   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 2b136d59047ef66c397048769ee2b88cb67447af
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Sat May 26 14:04:05 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2b136d59047ef66c397048769ee2b88cb67447af [^]

Related with issue 38505: Responsiveness check is retried, catch throwable instead of exception

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java
---
(0104729)
mtaal   
2018-05-28 00:07   
My remarks:
- log the throwable
- set an explicit readtimeout of 1 minute or 30 seconds or so. Currently it uses the readtimeout of the functional logic which can be 10-15 mins or infinite
(0104754)
hgbot   
2018-05-28 16:57   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 3f7ee63a1a714d4dc5ee30891f82c9dd7ca8fbde
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon May 28 16:57:21 2018 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3f7ee63a1a714d4dc5ee30891f82c9dd7ca8fbde [^]

Fixes issue 38505: Adds log and specifies sets timeout for responsiveness check

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java
---
(0104822)
mtaal   
2018-05-30 21:00   
The readtimeout should be set to a default lower value. The current changeset changes the connecttimeout.
(0104823)
hgbot   
2018-05-31 08:30   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 47652395ef3456122a9b369074bda27e51993f46
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu May 31 10:23:17 2018 +0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/47652395ef3456122a9b369074bda27e51993f46 [^]

Related with issue 38505: Overwrite read timeout, not connection timeout

Now when doing the central server responsiveness test, the read timeout is overwritten, instead of the connection timeout.

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java
---
(0104839)
mtaal   
2018-05-31 12:41   
Works fine tx, the exception which gets thrown for read time out is:
java.net.SocketTimeoutException: Read timed out
(0104840)
mtaal   
2018-05-31 12:41   
Reviewed