🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #16925

Re: bug in INN1.4unoff4 streaming code

#16925
From: Chris Sedore
Date: Sat, 12 Apr 1997 00:00
148 lines
7537 bytes


Jerry Aguirre <jerry@rigel.whowhere.com> wrote in article
<5imno1$5km$1@fes.whowhere.com>...
> In article <01bc4549$27b69ea0$1f8fe680@spring>,
> Chris Sedore <cmsedore@maxwell.syr.edu> wrote:
[...]
> In the INN implementation of streaming!  I considered implementing it
> by forking off a separate stream-only server that would handle the
> connection.  Consider the "mode reader" command which under INN sets up
> a separate process that will not understand "IHAVE".  In INN it would
> be fairly trivial to modify it to support mixed check/ihave commands.
> Just have IHAVE free the message ID buffer.  But it might not be so
> easy for another implemetation.
> 
> You have to ask yourself are you working on a robust portable protocol
> or a hack that will only work with certain implementations.  Remember
> the "be conservative in what you send" part?  Sorry if I sound too
> critical.  I just think it is not a very good idea to switch back and
> forth.

Yes, I remember.  What is not specified (and what we apparently disagree
on) is whether streaming is a protocol *extension* or a *separate*
protocol.  In the extension case (my view) it is perfectly logical and
acceptable to "switch" back and forth.  In fact, streaming is not a
separate protocol because it requires use of the previous return codes for
things like throttling and errors.

> >Most of the articles are rejected because they arrived before my
> >transmission completed.  The main disadvantage to takethis is that I
cannot
> 
> How do you know this?  Do you also have access to the server to check
> its logs?

Since I feed a number of other sites that have the exact same reject
parameters I do, with rare exception all the rejects will come from this.
 
> >determine if an article was really rejected, or if it was just too slow
in
> >coming.  This is important if I'm trying to determine whether to stay in
> >nocheck mode, or if I am calculating whether or not to close my check
[...]
> 
> There is code in innd to lock a message ID while it is being sent.  If
> innd gets an IHAVE for a new article then it will lock that ID for 60
> seconds(?).  If a second feed does an IHAVE of the same ID it will just
> hang the second connection waiting for the first to finish transferring
> the article.  If the article is there within the timeout then the
> second feed will refuse the article because it has already been
> processed.  Thus there is no window for duplicates.   (Unless the first
> sender is very slow and the lock times out.)

This exactly confirms my experience with INN.

> This is not ideal as a slow feed can stall others who are trying to
> send the same article.  There was some work in progress to have a
> different IHAVE response code, the "send it later" response.  Instead
> of hanging the second connection it would return a "send it later"
> response.  The second feed would be free to offer other articles.
> Hopefully it would retry the potential duplicate later and it would
> then be refused if the original transfer had been sucessful.

The "send it later" is a pain, but a necessary one I suppose.

> Under streaming mode there is a fully implemented "send it later"
> response code.  What may be causing increased duplicates is how the
> check and takethis code interacts with the message ID locking.  It was
> not very clear to me which was the best way to handle that.
> 
> Should a "check" command lock the ID on the assumption that the message
> will be sent soon?  Remember that there is no assumption with check that
> the article will soon follow.  With a large window and several
> "takethis" articles in the pipe it could be quite some time before the
> article was received.  And if the other feeds are using IHAVE
> then they will stall.

I lock on the check and I refuse the article from other hosts for the lock
time.  I plan to modify this to allow the article to be double-accepted and
possibly also to use the "try again later" code if desired,  too.

> I think what I did was to not lock the message ID on the check but did
[...]
> An interesting enhancement to streaming trasmisson would be to use the
> number of bytes in the pipe as a limit in addition to the number of
> check/takethis commands.  For small articles one requires a large window
[...]
which pipe are you refering to?
> 
> >I'm about ready to add a new command to NNTPRelay to enable it to return
> >438 when an article was received on another connection prior to the
> >termination on the current connection.  Maybe "mode advstream", though I
> >think this should be the default behavior.
> 
> I ran a fairly big server with at least 10 major incomming feeds plus
> quite a few slower feeds.  Every day I would get the log summary which
> included the number of duplicates received.  Yes, there were some but I
> never saw enough for me to worry about.  Sites sending me groups I
> didn't want was a bigger problem than duplicates.

I don't do incoming group checking and I think I probably have on the order
of 20 major feeds, maybe 30, depending on what "major" is.  I think our
total number is around 80-90 now.

> If your incomming feeds are diverse enough then the order of the
> articles will be sufficiently different that duplicates will not be a
> big problem.  If your incomming feed sites are so closely coupled that
> they are in "sync" then they are not providing real redundancy.  By
[..]

True, but if you are trying to reduce usenet propagation time, you have to
have many feeds to aggregate the traffic one "tier" lower than the current
arrangement (in hub and spoke terminology).  This means checking lots of
articles (we're currently doing 10-13 million db searches per day).

> Can you quantify the percentage of duplicates you are seeing?

Sure.  Currently I have these statistics:

Started Fri Apr 11 05:24:26 Eastern Daylight Time 1997
Uptime 0.18941 days
ihave 603415
ihave_accept 41493
ihave_refuse 523483
ihave_reject 38111
check 2141954
check_refuse 2086293
takethis 87185
takethis_refuse 49674
precommit_saves 101900
search 2911912
insert 79004

precommit_saves is the number of times that my locking code prevented an
article from being sent more than once.  This is currently 128% of the
number of articles I have actually accepted (insert).  takethis_refuse is
the number of times that an article was rejected--I called it this because
most of the time it is due to a refuse not a reject.  I'd estimate that
50-70% of these are actually duplicates.

My lock is implemented as a 25 article id circular queue.  Each lock from a
check, takethis, or IHAVE is held until it is pushed out.  This is normally
1-8 seconds depending on how bursty the traffic is.

-Chris

Technical Details
Message-ID: <01bc46e8$91616f10$9401e680@spring>
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
References: <01bc4481$01766ea0$1f8fe680@spring> <5igq95$2mk$1@fes.whowhere.com> <01bc4549$27b69ea0$1f8fe680@spring> <5imno1$5km$1@fes.whowhere.com>

Show Full Headers
Complete Article Headers
Message-ID: <01bc46e8$91616f10$9401e680@spring>
Subject: Re: bug in INN1.4unoff4 streaming code
Date: Sat, 12 Apr 1997 00:00:00 +0000
From: "Chris Sedore" <cmsedore@maxwell.syr.edu>
References: <01bc4481$01766ea0$1f8fe680@spring> <5igq95$2mk$1@fes.whowhere.com> <01bc4549$27b69ea0$1f8fe680@spring> <5imno1$5km$1@fes.whowhere.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: 234236789
Distribution: inet
Organization: Syracuse University, Syracuse, NY (USA)
Newsgroups: news.software.nntp