Article View: news.software.nntp
Article #11567Re: nntplink hang on article, why?
From: David C Lawrence
Date: Thu, 10 Oct 1996 00:00
Date: Thu, 10 Oct 1996 00:00
93 lines
5193 bytes
5193 bytes
charlie@deltanet.com (Charlie Lawrence) writes:
> I run 2 slave machines off my master using nntplink. When nntplink
> backs up it writes a file to my out.going directory where a cron job
> moves it and starts up another nntplink feed to the slave machine.
> What I'm finding is that normally the first article of the file
> hangs and nntplink exits. If I vi the line out the nntplink feed
> will start running until it finds another bad article then it
> hangs....... I can see the refered article in the proper news
> directory and in the .overview file of the master machine. What's
> broke?
A message I sent yesterday explains it ...
Date: Wed, 9 Oct 1996 17:46:40 -0400 (EDT)
From: tale@UU.NET (David C Lawrence)
Subject: bug: inn 1.4unoff4 & 1.5b1: some large articles not correctly "eaten"
(A patch is included at the end of this message; this problem also
applies to unoff4, but I do not know whether it is in 1.4sec)
Please forgive my verbosity. I like to be complete in identifying
problems and fixes like this.
Recently we had a recurring problem with some articles not working
their way through our system. The symptoms were that an article which
was just under the maximum size we allow (1 million bytes) would be
transferred by nntplink, which would send the required \r\n.\r\n at
end, but innd would not see the end marker. While innd kept waiting
for more data to be sent, nntplink was waiting for innd to say
something back to it. Eventually nntplink would time out, but then
would try the same article again, because it encountered what it
reasonably interpreted as a transient network error. Of course, the
problem didn't just magically go away and the whole news stream was
stalled. In a master/slave arrangement with a single nntp channel
feeding the slave, this could mean no news to the slaves for a very,
very long time.
The function NCproc(), which inspects the latest info to hit the nntp
channel buffer, was making the determination that the article was too
large and then switching the channel into "eat article" mode. When it
makes the switch, it moves the last SAVE_AMT (10) bytes of the buffer
to the head of the buffer and resets the buffer pointer to the new
end, 10. New reads on the channel start placing characters at that
point. In most cases, the \r\n.\r\n is eventually seen, the
"rejecting huge article" error message is spit out, and life continues
normally.
That is, unless the article is not more than 8k (minus fuzz) over the
maximum size limit. In this case, the end marker is never seen
because innd is looking up above one million bytes (or whatever your
max is), and the end marker is somewhere under ten thousand. This is
because another variable is left pointing at where the end of the
buffer is, so when the amount in the buffer is increased by the next
read, then NCproc() will only have to look at that last chunk to try
to find the end marker, rather than looking at the whole buffer.
The ultimate problem here is that the "end of last read" marker is not
reset to 10 when the end of the buffer is copied into the beginning
for the switch to "eat article" mode. The fix is trivial: reset the
"end of last read" marker.
The reason that this does not affect articles more than 8k over the
maximum article size is because after every 8k, "eat article" mode
does the same "copy last ten bytes" bit that started it, except that
section of the code resets the "end of last read" marker.
This patch does not address the fact that maximum article size is
being determined by the size of the article on the wire (with
networking encoding), or that "eat article" mode is moving the last
ten bytes to the first ten much more than it has to for really
humongous articles.
*** inn-1.5b1.dist/innd/nc.c Sat Sep 28 13:39:12 1996
--- inn-1.5b1/innd/nc.c Wed Oct 9 14:53:57 1996
***************
*** 1053,1059 ****
for (p = bp->Data, i = 0; i < SAVE_AMT; p++, i++)
p[0] = p[bp->Used - SAVE_AMT];
wp->Size += bp->Used - SAVE_AMT;
! bp->Used = SAVE_AMT;
cp->State = CSeatarticle;
}
cp->Rest = 0;
--- 1053,1059 ----
for (p = bp->Data, i = 0; i < SAVE_AMT; p++, i++)
p[0] = p[bp->Used - SAVE_AMT];
wp->Size += bp->Used - SAVE_AMT;
! bp->Used = cp->Lastch = SAVE_AMT;
cp->State = CSeatarticle;
}
cp->Rest = 0;
Technical Details
Message-ID:
<8bueawq4r.fsf@rodan.UU.NET>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<53gktj$ngs@news04.deltanet.com>Show Full Headers
Complete Article Headers
Message-ID: <8bueawq4r.fsf@rodan.UU.NET> Subject: Re: nntplink hang on article, why? Date: Thu, 10 Oct 1996 00:00:00 +0000 From: David C Lawrence <tale@uunet.uu.net> References: <53gktj$ngs@news04.deltanet.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 188558269 Organization: UUNET Technologies Inc, Fairfax VA USA Newsgroups: news.software.nntp