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

[tor-commits] [flashproxy/master] Ignore errors in close or logout in response to a previous error.



commit ee57a935510e15b1e4ec10a254e817606d94de25
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Sun May 12 20:15:15 2013 -0700

    Ignore errors in close or logout in response to a previous error.
    
    Had this stack trace from close:
    2013-05-06 06:05:39 lost server connection: command: SELECT => socket error: EOF
    Traceback (most recent call last):
      File "/usr/local/bin/facilitator-email-poller", line 336, in <module>
        imap.close()
      File "/usr/lib/python2.6/imaplib.py", line 375, in close
        typ, dat = self._simple_command('CLOSE')
      File "/usr/lib/python2.6/imaplib.py", line 1060, in _simple_command
        return self._command_complete(name, self._command(name, *args))
      File "/usr/lib/python2.6/imaplib.py", line 886, in _command_complete
        self._check_bye()
      File "/usr/lib/python2.6/imaplib.py", line 808, in _check_bye
        raise self.abort(bye[-1])
    imaplib.abort: Session expired, please login again.
---
 facilitator/facilitator-email-poller |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/facilitator/facilitator-email-poller b/facilitator/facilitator-email-poller
index 5b9c50b..f72222f 100755
--- a/facilitator/facilitator-email-poller
+++ b/facilitator/facilitator-email-poller
@@ -333,8 +333,12 @@ while True:
     except KeyboardInterrupt:
         break
 
-    imap.close()
-    imap.logout()
+    try:
+        imap.close()
+        imap.logout()
+    except imaplib.IMAP4.abort:
+        pass
+
     # Don't reconnect too fast.
     t = login_limit.time_to_wait()
     if t > 0:

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits