-
Notifications
You must be signed in to change notification settings - Fork 19
Description
By standard, the transaction timeout is 3 minutes :
de.nmichael.efa.data.efacloud.TxRequestQueue.SYNCHRONIZATION_TIMEOUT = 180000;
When setting up a new efacloud instance from a local project,
the upload sync may take longer than 3 minutes.
The code in de.nmichael.efa.data.efacloud.TxRequestQueue.startQueueTimer() requests a wrong state change:
// ============== time out for synchronization ======
if ((txq.getState() == TxRequestQueue.QUEUE_IS_SYNCHRONIZING)
&& ((System.currentTimeMillis() - synchControl.lastSynchStartedMillis) > SYNCHRONIZATION_TIMEOUT)) {
txq.registerStateChangeRequest(TxRequestQueue.RQ_QUEUE_RESUME);
txq.logApiMessage("Synchronization Timeout. "
+ International.getString("Die Synchronisation wird beendet."), 1);
}
This state change is discarded from efaCloud State Change machine, and the upload sync runs until the upload sync has been processed fully.
As Martin stated, a state change to STOP the sync would be better, but this leads to other problems in upload and download syncs, as the RQ_QUEUE_STOP_SYNCH is a state change which is used in a special way.
txq.registerStateChangeRequest(TxRequestQueue.RQ_QUEUE_STOP_SYNCH);
Better would maybe creating a new state TxRequestQueue.RQ_QUEUE_STOP_SYNCH_BY_TIMEOUT.
Add in de.nmichael.efa.data.efacloud.TxRequestQueue.startQueueTimer()
case RQ_QUEUE_STOP_SYNCH_BY_TIMEOUT: // End of synchronisation process, no manual option.
if (currentState == QUEUE_IS_SYNCHRONIZING) {
if (queues.get(TX_SYNCH_QUEUE_INDEX).size() == 0) {
txq.synchControl.logSynchMessage(
International.getString("Synchronisationstransaktionen abgeschlossen"),
"", null, false);
} else {
queues.get(TX_SYNCH_QUEUE_INDEX).clear();
txq.synchControl.logSynchMessage(
International.getString("Synchronisationstransaktionen abgebrochen"),
"", null, false);
}
stateTransitionRequests.remove(0);
txq.setState(QUEUE_IS_WORKING);
showStatusAtGUI();
} else
dropInvalidStateChangeRequest();
break;
And treating it like RQ_QUEUE_STOP_SYNCH in the other cases where RQ_QUEUE_STOP_SYNCH occurrs,
in special putting it in the topmost place of the queue:
de.nmichael.efa.data.efacloud.TxRequestQueue.registerStateChangeRequest(int)
This is a bigger change in efaCloud code.