--------------------- PatchSet 12309 Date: 2008/07/10 09:48:41 Author: hno Branch: SQUID_2_7 Tag: (none) Log: Bug #2408: assertion failed: forward.c:529: "fs" pinned connections is a bit special and we need to add the alternate paths even if it looks the same as a pinned one.. also make the forwarding logic a little more robust in case there is no server left to try. Members: src/forward.c:1.131.2.3->1.131.2.4 src/peer_select.c:1.134.2.3->1.134.2.4 Index: squid/src/forward.c =================================================================== RCS file: /cvsroot/squid/squid/src/forward.c,v retrieving revision 1.131.2.3 retrieving revision 1.131.2.4 diff -u -r1.131.2.3 -r1.131.2.4 --- squid/src/forward.c 19 Jun 2008 01:08:29 -0000 1.131.2.3 +++ squid/src/forward.c 10 Jul 2008 09:48:41 -0000 1.131.2.4 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.131.2.3 2008/06/19 01:08:29 hno Exp $ + * $Id: forward.c,v 1.131.2.4 2008/07/10 09:48:41 hno Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -53,6 +53,7 @@ static CNCB fwdConnectDone; static int fwdCheckRetry(FwdState * fwdState); static int fwdReforward(FwdState *); +static void fwdRestart(void *); static void fwdStartFail(FwdState *); static void fwdLogReplyStatus(int tries, http_status status); static OBJH fwdStats; @@ -207,7 +208,7 @@ } } /* use eventAdd to break potential call sequence loops and to slow things down a little */ - eventAdd("fwdConnectStart", fwdConnectStart, fwdState, originserver ? 0.05 : 0.005, 0); + eventAdd("fwdRestart", fwdRestart, fwdState, originserver ? 0.05 : 0.005, 0); return; } if (!fwdState->err && shutting_down) @@ -571,7 +572,7 @@ fwdState->request->pinned_connection = NULL; fwdState->servers = fs->next; fwdServerFree(fs); - fwdConnectStart(fwdState); + fwdRestart(fwdState); return; } #if LINUX_TPROXY @@ -697,6 +698,16 @@ } static void +fwdRestart(void *data) +{ + FwdState *fwdState = data; + if (fwdState->servers) + fwdConnectStart(fwdState); + else + fwdStartFail(fwdState); +} + +static void fwdStartComplete(FwdServer * servers, void *data) { FwdState *fwdState = data; Index: squid/src/peer_select.c =================================================================== RCS file: /cvsroot/squid/squid/src/peer_select.c,v retrieving revision 1.134.2.3 retrieving revision 1.134.2.4 diff -u -r1.134.2.3 -r1.134.2.4 --- squid/src/peer_select.c 24 Jun 2008 22:53:49 -0000 1.134.2.3 +++ squid/src/peer_select.c 10 Jul 2008 09:48:41 -0000 1.134.2.4 @@ -1,6 +1,6 @@ /* - * $Id: peer_select.c,v 1.134.2.3 2008/06/24 22:53:49 hno Exp $ + * $Id: peer_select.c,v 1.134.2.4 2008/07/10 09:48:41 hno Exp $ * * DEBUG: section 44 Peer Selection Algorithm * AUTHOR: Duane Wessels @@ -685,7 +685,7 @@ p ? p->name : "DIRECT", hier_strings[code]); while (*FS) { - if ((*FS)->peer == p) { + if ((*FS)->peer == p && (*FS)->code != PINNED) { debug(44, 5) ("peerAddFwdServer: Skipping duplicate registration of %s\n", p ? p->name : "DIRECT"); return; }