Commit db9bb5f4 authored by Michael Gratton's avatar Michael Gratton 馃

Limit number of times a reply op is retried before failing

This prevents the op being retried... forever 馃暩馃暩
parent beccdd49
Pipeline #56240 passed with stages
in 19 minutes and 50 seconds
......@@ -12,10 +12,18 @@
* ensure the execution of the operations maintains consistent.
*/
private class Geary.ImapEngine.ReplayQueue : Geary.BaseObject {
// this value is high because delays between back-to-back unsolicited notifications have been
// see as high as 250ms
// Maximum number of times a retry-able operation should be
// retried before failing. It's set to 1 since we only attempt to
// retry if there's some transient error, so if it doesn't work
// second time around, it probably won't work at all.
private const int MAX_OP_RETRIES = 1;
// This value is high because delays between back-to-back
// unsolicited notifications have been see as high as 250ms
private const int NOTIFICATION_QUEUE_WAIT_MSEC = 1000;
private enum State {
OPEN,
CLOSING,
......@@ -522,9 +530,10 @@ private class Geary.ImapEngine.ReplayQueue : Geary.BaseObject {
// If a recoverable failure and operation allows
// remote replay and not closing, re-schedule now
if ((op.on_remote_error == ReplayOperation.OnError.RETRY)
&& !is_unrecoverable_failure(replay_err)
&& state == State.OPEN) {
if (op.on_remote_error == ReplayOperation.OnError.RETRY &&
op.remote_retry_count <= MAX_OP_RETRIES &&
!is_unrecoverable_failure(replay_err) &&
state == State.OPEN) {
debug("Schedule op retry %s on %s", op.to_string(), to_string());
// the Folder will disconnect and reconnect due to the hard error and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment