[Pkg-wmaker-commits] [wmbiff] 79/84: more robust ETIMEDOUT handling -- just chill out for a few minues rather than blacklist as a compromise between the responsiveness of not retrying unresponsive servers and the robustness of prodding on. the right thing is probably a non-blocking connect, but that's messy

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:02:06 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to tag wmbiff_0_4_10
in repository wmbiff.

commit ac2c9b0381756f44dddc7c931702a3222ed0983a
Author: bluehal <bluehal>
Date:   Sat Nov 30 07:58:52 2002 +0000

    more robust ETIMEDOUT handling -- just chill out for a few minues rather than blacklist as a compromise between the responsiveness of not retrying unresponsive servers and the robustness of prodding on.  the right thing is probably a non-blocking connect, but that's  messy
---
 wmbiff/Imap4Client.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/wmbiff/Imap4Client.c b/wmbiff/Imap4Client.c
index 727c167..4f11a08 100644
--- a/wmbiff/Imap4Client.c
+++ b/wmbiff/Imap4Client.c
@@ -21,6 +21,7 @@
 #include <assert.h>
 #include <unistd.h>
 #include <errno.h>
+#include <time.h>
 
 #ifdef USE_DMALLOC
 #include <dmalloc.h>
@@ -168,14 +169,15 @@ FILE *imap_open(Pop3 pc)
 		IMAP_DM(pc, DEBUG_ERROR, "Couldn't connect to %s:%d: %s\n",
 				PCU.serverName, PCU.serverPort, strerror(errno));
 		if (errno == ETIMEDOUT) {
-			/* only give up if it was a time-consuming error */
-			/* try again later if it was just a connection refused */
-			IMAP_DM(pc, DEBUG_ERROR,
-					"Will not retry because this attempt to connect timed out.\n"
-					" This is done so that other mailboxes can be updated in a timely manner.\n"
-					" To try again to connect to %s:%d, restart wmbiff.\n",
-					PCU.serverName, PCU.serverPort);
-			bind_state_to_pcu(pc, initialize_blacklist(connection_name));
+          /* temporarily bump the interval, in a crude way:
+           fast forward time so that the mailbox isn't
+           checked for a while. */
+           pc->prevtime = time(0) + 60 * 5; /* now + 60 seconds * 5 minutes */
+          /* TCP's retry (how much time has elapsed while
+             the connect times out) is around 3 minutes;
+             here we just try to allow checking local
+             mailboxes more often while remote things are
+             unavailable or disconnected.  */
 		}
 		return NULL;
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git



More information about the Pkg-wmaker-commits mailing list