[geary] Don't reschedule folder op when closing: Bug #745561



commit e1b838f0d3fb7e82814af62a5583130e4d6bb55c
Author: Jim Nelson <jim yorba org>
Date:   Thu Mar 5 18:13:40 2015 -0800

    Don't reschedule folder op when closing: Bug #745561
    
    If the Folder is closing and there's network issues, old code would
    reschedule operations to allow for a retry when the connection was
    reestablished.  In the close case, there will be no reconnection
    and the operation would loop forever, blocking close/terminate
    operations which indicate the queue was flushed.  This change only
    reschedules an operation if the queue is open for business.

 .../imap-engine/imap-engine-replay-queue.vala      |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-replay-queue.vala 
b/src/engine/imap-engine/imap-engine-replay-queue.vala
index f9b85fe..ffb5b53 100644
--- a/src/engine/imap-engine/imap-engine-replay-queue.vala
+++ b/src/engine/imap-engine/imap-engine-replay-queue.vala
@@ -502,8 +502,11 @@ private class Geary.ImapEngine.ReplayQueue : Geary.BaseObject {
                     debug("Replay remote error for %s on %s: %s (%s)", op.to_string(), to_string(),
                         replay_err.message, op.on_remote_error.to_string());
                     
-                    // If a hard failure and operation allows remote replay, schedule now
-                    if ((op.on_remote_error == ReplayOperation.OnError.RETRY) && 
is_hard_failure(replay_err)) {
+                    // If a hard failure and operation allows remote replay and not closing,
+                    // re-schedule now
+                    if ((op.on_remote_error == ReplayOperation.OnError.RETRY)
+                        && is_hard_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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]