[leafnode-list] Re: leafnode 2.0.0.alpha20060711a: cannot parse reply...

Matthias Andree matthias.andree at gmx.de
Tue Aug 15 13:36:03 CEST 2006


Martin <virenfang at arcor.de> writes:

>> Probably improper escaping of leading dots on a line in some earlier
>> article.
>
> After "GROUP"ing not even one article was fetched. Therefore there can't
> be improper escaping of leading dots, I think.

It was just the most common cause of trouble and the first log wasn't as
useful as the one you included below.

> Having 3 or 4 servers in my leafnode/config, I appended "-S
> news.gmane.org". The output is quite more strange than the above:
>
> |gmane.editors.vim: 52 articles fetched (to 7175), 0 killed
> |news.gmane.org: backing up gmane.linux.gentoo.user.german from 26933 to
> |27433
> |gmane.linux.gentoo.user.german: considering 516 articles 26933 - 27448,
> |using XOVER
> |gmane.linux.gentoo.user.german: XOVER: 516 seen, 388 I have, 0 filtered,
> |128 to get
> |gmane.linux.gentoo.user.german: will fetch 128 articles
> |sent ARTICLE 27321 command, in pipe: 1
> |sent ARTICLE 27322 command, in pipe: 2
> |sent ARTICLE 27323 command, in pipe: 3
> |sent ARTICLE 27324 command, in pipe: 4
> |sent ARTICLE 27325 command, in pipe: 5
> |Wrong reply to ARTICLE command: "423 Bad article number"

And fetchnews stops fetching that group and proceeds to the next,
which is wrong.

>> > What more information is needed? Was this just an ordinary accident or
>> > is there something wrong (not enough time for waiting)?
>> 
>> Probably the server sending garbage.
>
> I suspected this, but I'm not sure any more.

Indeed, fetchnews wasn't handling the 423 reply properly.

Thank you very much for your debugging work.

This patch should fix the problem (it doesn't hurt if the "NEWS" part
fails). Note you must save the body of this article to a file and
redirect input from that file into patch.
Copy & Paste WILL NOT WORK.

Can you test the patch? If it works, I'll release a new snapshot
(one of the other benefits of alpha versions: less release overhead :-))

diff -rN -u old-leafnode-2/NEWS new-leafnode-2/NEWS
--- old-leafnode-2/NEWS	2006-08-15 11:33:47.000000000 +0000
+++ new-leafnode-2/NEWS	2006-08-15 11:33:47.000000000 +0000
@@ -2,6 +2,8 @@
 * The code sometimes uses timeout_client where it should use a server timeout.
 |
 Changes since 20060711a:
+- Bugfix: handle 400...499 codes in reply to ARTICLE command properly.
+  Reported by Martin Brunzel.
 - Update: the leafnode.spec.in file was updated to fix rpmbuild issues
   and instruct the packager how the %doc-umentation can be relocated.
   Reported by Kevin Bulgrien.
diff -rN -u old-leafnode-2/fetchnews.c new-leafnode-2/fetchnews.c
--- old-leafnode-2/fetchnews.c	2006-08-15 11:33:47.000000000 +0000
+++ new-leafnode-2/fetchnews.c	2006-08-15 11:33:47.000000000 +0000
@@ -410,8 +410,11 @@
 	    || (reply / 10 != 22)) {
 	ln_log(LNLOG_SNOTICE, LNLOG_CARTICLE,
 	       "Wrong reply to ARTICLE command: \"%s\"", l);
-	if (argcount < 2 || reply / 100 == 5)
+	/* don't complain if artno missing,
+	 * 423 replies for instance don't include it, but are non-fatal. */
+	if (reply >= 500 && reply < 600)
 	    return -2;		/* fatal error */
+	/* recoverable error */
 	return -1;
     }
 
@@ -1136,7 +1139,7 @@
     struct filterlist *f = NULL;
     int x = 0;
     long outstanding = 0;
-    unsigned long last = 0;
+    unsigned long last = 0, u;
     int delaybody_this_group;
     int tryxhdr = 0;
 
@@ -1256,8 +1259,15 @@
 
     groupfetched = 0;
     groupkilled = 0;
-    if (getarticles(stufftoget, outstanding, f) == 0) {
-	/* handle error */
+
+    u = getarticles(stufftoget, outstanding, f);
+    freefilter(f);
+    freelist(stufftoget);
+    if (u == 0) {
+	ln_log(LNLOG_SERR, LNLOG_CGROUP,
+		"%s: error fetching, proceeding to next server",
+		g->name);
+	return -2;
     }
     ln_log(LNLOG_SNOTICE, LNLOG_CGROUP,
 	   "%s: %lu articles fetched (to %lu), %lu killed",
@@ -1265,8 +1275,6 @@
     globalfetched += groupfetched;
     globalkilled += groupkilled;
 
-    freefilter(f);
-    freelist(stufftoget);
     return last + 1;
 }
 
-- 
Matthias Andree



More information about the leafnode-list mailing list