Skip to content

EFA#128 efaCloud: Transaction timeout handling does not work #257

@cubitusgh2

Description

@cubitusgh2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions