🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
28 messages
28 total messages Started by Howard Siegel Wed, 24 Oct 2001 02:54
Article numbering and handling article number rollover
#54781
Author: Howard Siegel
Date: Wed, 24 Oct 2001 02:54
40 lines
2924 bytes
I need to write a specialized NNTP client program (NOT a full
fledged news reader!) and as I have not tried to read through
any of the "brand name" news readers as yet (but I have very
little time to devote to this project), I'd like the sage
advise of the experts on the matter....

1) What is the largest article number that I can expect to get
   back from the NNTP server?  Is a signed 32 integer sufficient
   to hold article numbers?

2) What is the proper way to detect rollover of the article
   numbers?  I suppose that if the highest article number
   the server says it has is smaller than the highest article
   number the newsrc says was read, then the article numbers
   have rolled over.  Is that the canonical way or is there
   a better way?

3) What is the proper response for resetting the article list
   in the newsrc file when rollover is detected?  Do I throw
   out the old article list and set the new article list to
   1 through the (<lowest-nntp-server-article-number> - 1)?

- howard

PS: I have already done some investigation, and under the
current circumstances and constraints, have decided that the
specialized NNTP client is the most expediant course of action
for this project. I have already had the "discussions" with folks
who have said "just put up a small Linux box running as a news
server, etc., etc., etc.". We don't have the resources or desire
to support running our own news server at this time just for this
one little function we would like to implement, and already have
access to a news server that more than adequately serves it's
purpose for general news consumption. So PLEASE, do not answer
if your are only going to suggest "put up your own news server".
I really just need the answers to the questions above to continue
the work I have already begun.

Re: Article numbering and handling article number rollover
#54783
Author: Andrew Gierth
Date: Wed, 24 Oct 2001 03:06
37 lines
2412 bytes
[Bogus "Distribution: inet" removed.]

>>>>> "Howard" == Howard Siegel <not.interested@nospam.invalid> writes:

 Howard> I need to write a specialized NNTP client program (NOT a full
 Howard> fledged news reader!) and as I have not tried to read through
 Howard> any of the "brand name" news readers as yet (but I have very
 Howard> little time to devote to this project), I'd like the sage
 Howard> advise of the experts on the matter....

 Howard> 1) What is the largest article number that I can expect to
 Howard> get back from the NNTP server?

2^32-1

 Howard> Is a signed 32 integer sufficient to hold article numbers?

no, but an unsigned one is. (note also that 0 is not a valid article
number)

 Howard> 2) What is the proper way to detect rollover of the article
 Howard> numbers?

Article numbers don't roll over; the server breaks instead :-)

(Seriously, 2^32 articles is a _lot_, enough for over 10 thousand
years at 1000 articles per day.)

What _can_ happen is that the server dies and is replaced, or the
article numbers are reset for some other reason. If the article
numbers returned from the server are wildly different from the old
ones, you may want to throw the old info away (after confirming with
the user) and reset.

-- 
Andrew.
Re: Article numbering and handling article number rollover
#54784
Author: Howard Siegel
Date: Wed, 24 Oct 2001 04:56
58 lines
2970 bytes
Andrew,

Thanks for the info...

andrew@erlenstar.demon.co.uk writes:
>  Howard> 1) What is the largest article number that I can expect to
>  Howard> get back from the NNTP server?
> 
> 2^32-1

That's a seriously large number!

>  Howard> Is a signed 32 integer sufficient to hold article numbers?
> 
> no, but an unsigned one is.

OK.  Anyone know if perl (5.005.3) can handle integers that large?

> (note also that 0 is not a valid article number)

Knew that already.

>  Howard> 2) What is the proper way to detect rollover of the article
>  Howard> numbers?
> 
> Article numbers don't roll over; the server breaks instead :-)
> 
> (Seriously, 2^32 articles is a _lot_, enough for over 10 thousand
> years at 1000 articles per day.)

We will be sucking down only a very small (nominally 5 groups), hand
selected, set of groups with this program.  None of the groups has
that kind of traffic, so I suppose I can just punt on this issue, but
I'm still curious as to the proper action to take should something
somewhere ever cause the article numbering to restart way up there
rather than at 1.

> What _can_ happen is that the server dies and is replaced, or the
> article numbers are reset for some other reason. If the article
> numbers returned from the server are wildly different from the old
> ones, you may want to throw the old info away

Anyone know what algorithm the "brand name" news readers use to detect
'wildly different' numbers and what they do to reset the newsrc article
number list when this happens?

> (after confirming with the user) and reset.

Not going to be a 'user' per se.  This thing needs to run in the
background and not require human intervention unless it get's hopelessly
confused, which might be what happens in this case.

- howard
-- 

-- 
Netcom Class of '93, RIP Netcom!     <*>     hsiegel<->at<->pobox<->dot<->com
Re: Article numbering and handling article number rollover
#54785
Author: Andrew Gierth
Date: Wed, 24 Oct 2001 05:41
25 lines
2122 bytes
>>>>> "Howard" == Howard Siegel <not.interested@nospam.invalid> writes:

 >> no, but an unsigned one is.

 Howard> OK.  Anyone know if perl (5.005.3) can handle integers that
 Howard> large?

Perl uses doubles for numbers by default, so no problem.

 >> What _can_ happen is that the server dies and is replaced, or the
 >> article numbers are reset for some other reason. If the article
 >> numbers returned from the server are wildly different from the old
 >> ones, you may want to throw the old info away

 Howard> Anyone know what algorithm the "brand name" news readers use
 Howard> to detect 'wildly different' numbers and what they do to
 Howard> reset the newsrc article number list when this happens?

Generally they just break, and require that the user manually reset the
group, or unsubscribe and resubscribe, or in extreme cases re-initialise
as though using a new server.

-- 
Andrew.
Re: Article numbering and handling article number rollover
#54786
Author: Paul Colquhoun
Date: Wed, 24 Oct 2001 07:00
57 lines
3924 bytes
On 24 Oct 2001 02:54:09 GMT, Howard Siegel <not.interested@nospam.invalid> wrote:
| 
| I need to write a specialized NNTP client program (NOT a full
| fledged news reader!) and as I have not tried to read through
| any of the "brand name" news readers as yet (but I have very
| little time to devote to this project), I'd like the sage
| advise of the experts on the matter....
| 
| 1) What is the largest article number that I can expect to get
|    back from the NNTP server?  Is a signed 32 integer sufficient
|    to hold article numbers?
| 
| 2) What is the proper way to detect rollover of the article
|    numbers?  I suppose that if the highest article number
|    the server says it has is smaller than the highest article
|    number the newsrc says was read, then the article numbers
|    have rolled over.  Is that the canonical way or is there
|    a better way?
| 
| 3) What is the proper response for resetting the article list
|    in the newsrc file when rollover is detected?  Do I throw
|    out the old article list and set the new article list to
|    1 through the (<lowest-nntp-server-article-number> - 1)?
| 
| - howard
| 
| PS: I have already done some investigation, and under the
| current circumstances and constraints, have decided that the
| specialized NNTP client is the most expediant course of action
| for this project. I have already had the "discussions" with folks
| who have said "just put up a small Linux box running as a news
| server, etc., etc., etc.". We don't have the resources or desire
| to support running our own news server at this time just for this
| one little function we would like to implement, and already have
| access to a news server that more than adequately serves it's
| purpose for general news consumption. So PLEASE, do not answer
| if your are only going to suggest "put up your own news server".
| I really just need the answers to the questions above to continue
| the work I have already begun.


Have you thought of using something like slrnpull or leafnode to just
pull down the articles in the groups you are interested in?

I know that slrnpull workes quite well, and leaves the articles in a
spool directory, one file per article.

Not surprisingly, the slrn newsreader can read from this spool.


-- 
Reverend Paul Colquhoun, ULC.    http://andor.dropbear.id.au/~paulcol
     Asking for technical help in newsgroups?  Read this first:
        http://www.tuxedo.org/~esr/faqs/smart-questions.html
           "Mary had a crypto key, she kept it in escrow,
     and everything that Mary said, the Feds were sure to know."
Re: Article numbering and handling article number rollover
#54787
Author: Erik Hensema
Date: Wed, 24 Oct 2001 09:11
35 lines
2537 bytes
Andrew Gierth (andrew@erlenstar.demon.co.uk) wrote:
>>>>>> "Howard" == Howard Siegel <not.interested@nospam.invalid> writes:
>
> >> no, but an unsigned one is.
>
> Howard> OK.  Anyone know if perl (5.005.3) can handle integers that
> Howard> large?
>
>Perl uses doubles for numbers by default, so no problem.
>
> >> What _can_ happen is that the server dies and is replaced, or the
> >> article numbers are reset for some other reason. If the article
> >> numbers returned from the server are wildly different from the old
> >> ones, you may want to throw the old info away
>
> Howard> Anyone know what algorithm the "brand name" news readers use
> Howard> to detect 'wildly different' numbers and what they do to
> Howard> reset the newsrc article number list when this happens?
>
>Generally they just break, and require that the user manually reset the
>group, or unsubscribe and resubscribe, or in extreme cases re-initialise
>as though using a new server.

It may take a while to get a rollover too: the largest articlenumber I can
see is 109188055 in control.cancel at news.workbenelux.nl. That server is
about a year old, I think. Assuming it hasn't rolled over yet and the
traffic in control.cancel doesn't increase any further, it'll take another
twenty years for the number to roll over.

-- 
Erik Hensema (erik@hensema.xs4all.nl) || ICQ# 8280101
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
		-- Random Shack Data Processing Dictionary
Re: Article numbering and handling article number rollover
#54788
Author: Paul Tomblin
Date: Wed, 24 Oct 2001 12:11
13 lines
1626 bytes
In a previous article, Andrew Gierth <andrew@erlenstar.demon.co.uk> said:
>(Seriously, 2^32 articles is a _lot_, enough for over 10 thousand
>years at 1000 articles per day.)

Or three days of one of the binaries groups.


-- 
Paul Tomblin <ptomblin@xcski.com>, not speaking for anybody
"If something's expensive to develop, and somebody's not going to get paid, it
won't get developed. So you decide: Do you want software to be written, or
not?" - Bill Gates doesn't foresee the FSF or Linux, 1980.
Re: Article numbering and handling article number rollover
#54789
Author: Curt Welch
Date: Wed, 24 Oct 2001 13:44
31 lines
2740 bytes
Howard Siegel <not.interested@nospam.invalid> wrote:

> Anyone know what algorithm the "brand name" news readers use to detect
> 'wildly different' numbers and what they do to reset the newsrc article
> number list when this happens?

I don't know what each of the brand names do, but creating a workable
algorithm is not hard.  The newsreader needs to keep track of the last
article range it saw for each group, and within that range, which articles
the user has read.  When it connects to the server and gets a new article
range, it simply assumes all the articles in the new range which were
not already marked as "read" from the old range, should be considered
"new".

If you don't keep track of the lower bound of the range, then dealing
with article numbers that have been reset doesn't just work automatically,
so you need to add a test to see if the high water mark drops.  When it
does, you just assume all the articles are "new" again by throwing out
the current newsrc info.  You will probably want to put in some type
of test of how much it changed and only reset the list if it drops by
a lot (100 or so maybe).

The fine points of how you code it will depend on which of the possible
errors you are more willing to accept (i.e. seeing old articles again when
they were already marked as read or missing some new articles when the
group is reset).

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Article numbering and handling article number rollover
#54792
Author: Howard Siegel
Date: Wed, 24 Oct 2001 16:15
55 lines
3725 bytes
postmaster@andor.dropbear.id.au writes:
> On 24 Oct 2001 02:54:09 GMT, Howard Siegel <not.interested@nospam.invalid> wrote:
> | 
> | I need to write a specialized NNTP client program (NOT a full
> | fledged news reader!) and as I have not tried to read through
> | any of the "brand name" news readers as yet (but I have very
> | little time to devote to this project), I'd like the sage
> | advise of the experts on the matter....
> | 
> | <snip>
> | 
> | PS: I have already done some investigation, and under the
> | current circumstances and constraints, have decided that the
> | specialized NNTP client is the most expediant course of action
> | for this project. I have already had the "discussions" with folks
> | who have said "just put up a small Linux box running as a news
> | server, etc., etc., etc.". We don't have the resources or desire
> | to support running our own news server at this time just for this
> | one little function we would like to implement, and already have
> | access to a news server that more than adequately serves it's
> | purpose for general news consumption. So PLEASE, do not answer
> | if your are only going to suggest "put up your own news server".
> | I really just need the answers to the questions above to continue
> | the work I have already begun.
> 
> 
> Have you thought of using something like slrnpull or leafnode to just
> pull down the articles in the groups you are interested in?
> 
> I know that slrnpull workes quite well, and leaves the articles in a
> spool directory, one file per article.
> 
> Not surprisingly, the slrn newsreader can read from this spool.

Considered (in concept as opposed to slrnpull or leafnode specifically)
and rejected. Basically these are just mini news servers in that they
provide a filterred connection to another news server and create a local
news spool for "offline" reading.  These programs may be coerced in to
doing what we need, but they are none the less overkill for what we are
trying to do.  And as stated, we do not want to run our own news server
(of any kind).

If we were to use one of the mentioned programs, we would then need
additional s/w to go "the last mile" and we would have to be able to
read the news spool.  If we have to write our own client anyway, we'll
just suck off of the existing NNTP news server with a special purpose
client (as in NOT interactive) and have less third party software to
build, install and maintain.

- howard
-- 

-- 
Netcom Class of '93, RIP Netcom!     <*>     hsiegel<->at<->pobox<->dot<->com
Re: Article numbering and handling article number rollover
#54794
Author: Jeffrey M. Vinocur
Date: Wed, 24 Oct 2001 16:43
13 lines
1467 bytes
In article <9r6pem$k4a$1@news.panix.com>,
Howard Siegel  <not.interested@nospam.invalid> wrote:
>
>And as stated, we do not want to run our own news server

FWIW, you might consider describing your problem in full and
seeing if anyone has a good suggestion...you never know...


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Article numbering and handling article number rollover
#54797
Author: Howard Siegel
Date: Wed, 24 Oct 2001 17:28
44 lines
3050 bytes
jeff@litech.org writes:
> FWIW, you might consider describing your problem in full and
> seeing if anyone has a good suggestion...you never know...

True, but...

As stated previously, I have already had the discussions in
another venue with lots of knowledgeable people.  I have
also seen prior discussions in these groups which have been
applicable and have used that information to decide on our
direction.  I have neither the time nor energy to restart
those discussions in a new venue nor to restart those same
discussions which have already taken place.  The specific
and related subject areas have already been hashed, rehashed,
and trashed to death here too many times already with lots
of good information and ideas and, unfortunately, all the
attendant topic drift and flamage that ensues.

The bottom line is that we have already made our decision on
the direction we want to pursue at this time and really only
needed answers to a few questions about how to handle article
numberring and number rollover/reset issues.

I understand the desire to help and get to the bottom of the
situation and hash out new ideas or revisit old ones and I
applaud it (and sometimes join the discussions).  I don't
want to stifle any of that.  But sometimes one just needs the
answers to some basic questions without a lot of discussion.
This is one of those times.

- howard

(It is the inescapable nature of Usenet that every discussion
gets recycled continuously because the old articles expire and
along comes a newbie (either truly a newbie or just a newbie
in the specific subject area) and everything starts all over
again. I've been here long enough to have seen these discussions
already and do not want to start the cycle all over again!)

-- 

-- 
Netcom Class of '93, RIP Netcom!     <*>     hsiegel<->at<->pobox<->dot<->com
Re: Article numbering and handling article number rollover
#54798
Author: Murray Peterson
Date: Wed, 24 Oct 2001 17:43
19 lines
1991 bytes
Howard Siegel <not.interested@nospam.invalid> wrote in 
news:9r6tn3$lk4$1@news.panix.com:

> (It is the inescapable nature of Usenet that every discussion
> gets recycled continuously because the old articles expire and
> along comes a newbie (either truly a newbie or just a newbie
> in the specific subject area) and everything starts all over
> again. I've been here long enough to have seen these discussions
> already and do not want to start the cycle all over again!)

The proper thing to do for these cases is to point them to the relevant 
thread on the google archive (and as a side effect, teach them how to 
search the archives for themselves).

-- 
Murray Peterson
Email: murray_peterson@home.com (remove underscore)
URL:   http://members.shaw.ca/murraypeterson/
Re: Article numbering and handling article number rollover
#54800
Author: Howard Siegel
Date: Wed, 24 Oct 2001 19:20
41 lines
2783 bytes
mwp@home.com.invalid writes:
> Howard Siegel <not.interested@nospam.invalid> wrote in 
> news:9r6tn3$lk4$1@news.panix.com:
> 
> > (It is the inescapable nature of Usenet that every discussion
> > gets recycled continuously because the old articles expire and
> > along comes a newbie (either truly a newbie or just a newbie
> > in the specific subject area) and everything starts all over
> > again. I've been here long enough to have seen these discussions
> > already and do not want to start the cycle all over again!)
> 
> The proper thing to do for these cases is to point them to the relevant 
> thread on the google archive (and as a side effect, teach them how to 
> search the archives for themselves).

Don'cha just love topic drift;-)  (Which proves the point I was trying
to make about restarting the discussion yet again with it's attendant
side conversations!).

Yes, pointing them at the archives is the way to treat the newbie
type of question.

Lest one question my own intents and newbie-ness, I have been
looking at the archives, but haven't yet found the answers to my
questions there, so I brought them up here.  If someone has a
pointer to an archived posting with the relevant answers, please
do let us all know what it is.

On the other hand, I did specifically say that I was only interested
in the answers to my questions and not in a general discussion of
what I'm trying to do, on what platform, on what OS, etc., etc., etc.

So, can we please get back to the questions at hand and stop the
driftage.

- howard
-- 

-- 
Netcom Class of '93, RIP Netcom!     <*>     hsiegel<->at<->pobox<->dot<->com
Re: Article numbering and handling article number rollover
#54801
Author: Murray Peterson
Date: Wed, 24 Oct 2001 19:34
34 lines
2572 bytes
Howard Siegel <not.interested@nospam.invalid> wrote in 
news:9r74ak$nss$1@news.panix.com:

> On the other hand, I did specifically say that I was only interested
> in the answers to my questions and not in a general discussion of
> what I'm trying to do, on what platform, on what OS, etc., etc., etc.
> 
> So, can we please get back to the questions at hand and stop the
> driftage.
> 

OK -- here's the "correct" answer to just your question:

Write your newsrc handler to do proper modulus arithmetic, so that 
"rollover" isn't an issue.  In other words, don't use greater-than or less-
than comparisons -- just calculate the distance from the previously read  
articles.  e.g. 1 - 2^32-1 == 1 and so on.  Your newsrc can now handle 
ranges that read (for example):

alt.test: 1-4294967292,4294967294-42,44,48-50

This will correctly handle the server resetting the article numbers at any 
point in time, not just rollover when max-int has been reached.

The problem with answering "just what you asked", is that this solution now 
precludes using many pre-written newsrc handlers.  Is this what your really 
want?  Well, we really don't know, so all we can do is give you theoretical 
answers.

-- 
Murray Peterson
Email: murray_peterson@home.com (remove underscore)
URL:   http://members.shaw.ca/murraypeterson/
Re: Article numbering and handling article number rollover
#54803
Author: Paul Colquhoun
Date: Wed, 24 Oct 2001 23:00
55 lines
3793 bytes
On 24 Oct 2001 16:15:18 GMT, Howard Siegel <not.interested@nospam.invalid> wrote:
| postmaster@andor.dropbear.id.au writes:
|> On 24 Oct 2001 02:54:09 GMT, Howard Siegel <not.interested@nospam.invalid> wrote:
|> | 
|> | I need to write a specialized NNTP client program (NOT a full
|> | fledged news reader!) and as I have not tried to read through
|> | any of the "brand name" news readers as yet (but I have very
|> | little time to devote to this project), I'd like the sage
|> | advise of the experts on the matter....
|> | 
|> | <snip>
|> | 
|> | PS: I have already done some investigation, and under the
|> | current circumstances and constraints, have decided that the
|> | specialized NNTP client is the most expediant course of action
|> | for this project. I have already had the "discussions" with folks
|> 
|> 
|> Have you thought of using something like slrnpull or leafnode to just
|> pull down the articles in the groups you are interested in?
|> 
|> I know that slrnpull workes quite well, and leaves the articles in a
|> spool directory, one file per article.
|> 
|> Not surprisingly, the slrn newsreader can read from this spool.
| 
| Considered (in concept as opposed to slrnpull or leafnode specifically)
| and rejected. Basically these are just mini news servers in that they
| provide a filterred connection to another news server and create a local
| news spool for "offline" reading.  These programs may be coerced in to
| doing what we need, but they are none the less overkill for what we are
| trying to do.  And as stated, we do not want to run our own news server
| (of any kind).
| 
| If we were to use one of the mentioned programs, we would then need
| additional s/w to go "the last mile" and we would have to be able to
| read the news spool.  If we have to write our own client anyway, we'll
| just suck off of the existing NNTP news server with a special purpose
| client (as in NOT interactive) and have less third party software to
| build, install and maintain.


Then grab the slrnpull source code and modify the "write to spool" bits
to do what you want, while keeping the "read from NNTP server" stuff.

No need to completely reinvent the wheel.


-- 
Reverend Paul Colquhoun, ULC.    http://andor.dropbear.id.au/~paulcol
     Asking for technical help in newsgroups?  Read this first:
        http://www.tuxedo.org/~esr/faqs/smart-questions.html
           "Mary had a crypto key, she kept it in escrow,
     and everything that Mary said, the Feds were sure to know."
Re: Article numbering and handling article number rollover
#54804
Author: Howard Siegel
Date: Wed, 24 Oct 2001 23:57
94 lines
6161 bytes
postmaster@andor.dropbear.id.au writes:
> On 24 Oct 2001 16:15:18 GMT, Howard Siegel <not.interested@nospam.invalid> wrote:
> | postmaster@andor.dropbear.id.au writes:
> |> On 24 Oct 2001 02:54:09 GMT, Howard Siegel <not.interested@nospam.invalid> wrote:
> |> | 
> |> | I need to write a specialized NNTP client program (NOT a full
> |> | fledged news reader!) and as I have not tried to read through
> |> | any of the "brand name" news readers as yet (but I have very
> |> | little time to devote to this project), I'd like the sage
> |> | advise of the experts on the matter....
> |> | 
> |> | <snip>
> |> | 
> |> | PS: I have already done some investigation, and under the
> |> | current circumstances and constraints, have decided that the
> |> | specialized NNTP client is the most expediant course of action
> |> | for this project. I have already had the "discussions" with folks
> |> 
> |> 
> |> Have you thought of using something like slrnpull or leafnode to just
> |> pull down the articles in the groups you are interested in?
> |> 
> |> I know that slrnpull workes quite well, and leaves the articles in a
> |> spool directory, one file per article.
> |> 
> |> Not surprisingly, the slrn newsreader can read from this spool.
> | 
> | Considered (in concept as opposed to slrnpull or leafnode specifically)
> | and rejected. Basically these are just mini news servers in that they
> | provide a filterred connection to another news server and create a local
> | news spool for "offline" reading.  These programs may be coerced in to
> | doing what we need, but they are none the less overkill for what we are
> | trying to do.  And as stated, we do not want to run our own news server
> | (of any kind).
> | 
> | If we were to use one of the mentioned programs, we would then need
> | additional s/w to go "the last mile" and we would have to be able to
> | read the news spool.  If we have to write our own client anyway, we'll
> | just suck off of the existing NNTP news server with a special purpose
> | client (as in NOT interactive) and have less third party software to
> | build, install and maintain.
> 
> 
> Then grab the slrnpull source code and modify the "write to spool" bits
> to do what you want, while keeping the "read from NNTP server" stuff.
> 
> No need to completely reinvent the wheel.

This was one of the paths that we considered, but ultimately decided that
for what we need (which is very little), it would be more work to take an
existing program, be it a client or mini-server, and pare it down to what
we needed than to write a new program to do what we needed.  One of the
decision factors was to write the new program in perl so that we can take
advantage of the existing NNTP interface and other available packages.  If
we did not have perl available or had decided to use a "real" language, then
these other programs would be my starting points (and would have provided
the answers, too).  By even mentioning that we were lucky to have perl
available, it should now be obvious that we are not using a platform that
is considered mainstream these days, so use of these other programs would
be problematic.

I have a bare minimum proof-of-concept already written, but it does not
yet do any seen article list or newsrc file maintenance, hence my questions.
The proof-of-concept program is 12 lines of perl and took all of approx an
2 hours to write given my ultra-newbie-ness with perl.  Besides article list
and newsrc file maintenance, it'll need to be made a bit more robust (ie.
better error processing and such).  But, I'd have had to spend much, much
more time just trying to compile any of the existing clients or mini-servers
on our platform/OS (even assuming they are written in C and that I have many
years of experience with C) before I could start making them do what we need.
Even if our perl program ultimately ends up being 100 or 200 lines of code,
this is considerably smaller than any of the programs mentioned.  So, I
really do have some idea that the path I'm on is the right one for us at
this time.

[This is beginning to turn in to the same discussions I've already had and
didn't want to rehash, only to come to basically the same path I'm already
on. Sigh!]

BTW, I have now found some of the prior exchanges about article numbering
and article list maintenance when faced with a forced reset of the article
numbers (of which a rollover is just one example), but I still don't see
much in the way of how to actually handle the problem without some from of
human intervention or a "just issue a warning message and start over from
1" type of response.  I was hoping for something a little less dependent
on a human or a little less drastic.  Perhaps there is nothing in the
middle that is easily implemented.

- howard
-- 

-- 
Netcom Class of '93, RIP Netcom!     <*>     hsiegel<->at<->pobox<->dot<->com
Re: Article numbering and handling article number rollover
#54808
Author: K. Ari Krupnikov
Date: Thu, 25 Oct 2001 19:24
17 lines
2400 bytes
Howard Siegel wrote:
> 
> I have a bare minimum proof-of-concept already written, but it does not
> yet do any seen article list or newsrc file maintenance, hence my questions.
> The proof-of-concept program is 12 lines of perl and took all of approx an
> 2 hours to write given my ultra-newbie-ness with perl.  Besides article list
> and newsrc file maintenance, it'll need to be made a bit more robust (ie.
> better error processing and such).

Do you specifically need article numbers, or do you just want to get all
new articles in a set of groups?
Perhaps you would be better off asking the server "NEWNEWS wildcard
date"? If you are only interested in the number of messages in a
newsgroup, simply count the messag-ids that the server returns.

Ari.
Re: Article numbering and handling article number rollover
#54829
Author: Jim Crowther
Date: Sat, 27 Oct 2001 11:08
19 lines
2117 bytes
In message <9r7kh0$ci$1@news.panix.com>, Howard Siegel 
<not.interested@nospam.invalid> writes

>BTW, I have now found some of the prior exchanges about article 
>numbering and article list maintenance when faced with a forced reset 
>of the article numbers (of which a rollover is just one example), but I 
>still don't see much in the way of how to actually handle the problem 
>without some from of human intervention or a "just issue a warning 
>message and start over from 1" type of response.

If the server handles NEWNEWS, why not use that?  I avoid all 'article 
re-numbering' issues this way.

-- 
Jim Crowther                 "It's MY computer" �
<http://pchelpers.org>
<http://website.lineone.net/~legal.defence.fund/>
Key ID 0xC56DD45F (DH/DSS 2048/1024)
Re: Article numbering and handling article number rollover
#54830
Author: Curt Welch
Date: Sat, 27 Oct 2001 16:08
32 lines
2981 bytes
Howard Siegel <not.interested@nospam.invalid> wrote:
> BTW, I have now found some of the prior exchanges about article numbering
> and article list maintenance when faced with a forced reset of the
> article numbers (of which a rollover is just one example), but I still
> don't see much in the way of how to actually handle the problem without
> some from of human intervention or a "just issue a warning message and
> start over from 1" type of response.  I was hoping for something a little
> less dependent on a human or a little less drastic.  Perhaps there is
> nothing in the middle that is easily implemented.

The responses posted to this thread does explain how to handle it without
any human intervention or without the need for a warning message.  Why
don't you see that?

The only issue is the danger of either 1) reading some of the same articles
twice when your software "thinks" they should be different, or 2) missing
some of the articles when the reset happens.

When a server resets it's numbers, there's a damn good chance that 2 will
happen and that there's nothing you or your software can do about it.

You can minimize both the errors of 1 and 2 above if it's really important
to your applicaton by saving the Message-ID of every article you have read
in the past.  Whenever the article numbers change in an unexpected way, you
simply rescan all the current articles on the server and compare the
message-ids to your list to know for sure which articles are old and which
are new.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Article numbering and handling article number rollover
#54832
Author: Jim Crowther
Date: Sat, 27 Oct 2001 17:34
17 lines
1986 bytes
In message <20011027120822.874$cf@newsreader.com>, Curt Welch 
<curt@kcwc.com> writes
>Whenever the article numbers change in an unexpected way, you simply 
>rescan all the current articles on the server and compare the 
>message-ids to your list to know for sure which articles are old and 
>which are new.

Indeed.  Why consider the article numbers anyway - the MIDs should 
provide all the information required for fetching, indexing and 
threading.

-- 
Jim Crowther                 "It's MY computer" �
<http://pchelpers.org>
<http://website.lineone.net/~legal.defence.fund/>
Key ID 0xC56DD45F (DH/DSS 2048/1024)
Re: Article numbering and handling article number rollover
#54833
Author: Howard Siegel
Date: Sat, 27 Oct 2001 17:37
13 lines
1543 bytes
To the folks who suggested just using NEWNEWS and only remember the
date/time at whichit was done rather than trying to track article
numbers... Thanks.  I'd been thinking too much along the lines of
a standard client type program to see the forest for the trees in
this instance.  I'll give it a try.

- howard

-- 

-- 
Netcom Class of '93, RIP Netcom!     <*>     hsiegel<->at<->pobox<->dot<->com
Re: Article numbering and handling article number rollover
#54834
Author: Jim Crowther
Date: Sat, 27 Oct 2001 18:14
20 lines
2248 bytes
In message <9rercv$jo9$1@news.panix.com>, Howard Siegel 
<not.interested@nospam.invalid> writes
>To the folks who suggested just using NEWNEWS and only remember the
>date/time at whichit was done rather than trying to track article
>numbers... Thanks.  I'd been thinking too much along the lines of
>a standard client type program to see the forest for the trees in
>this instance.  I'll give it a try.
>
There is the proviso that the server will have to allow this.  Some 
servers that nominally don't will give individual users NEWNEWS 
permission on request - news.cis.dfn.de used to do this until they made 
it open to all.  I suspect so few clients use NEWNEWS there is no 
significant overhead on the server to let those who wish it, to do so.

-- 
Jim Crowther                 "It's MY computer" �
<http://pchelpers.org>
<http://website.lineone.net/~legal.defence.fund/>
Key ID 0xC56DD45F (DH/DSS 2048/1024)
Re: Article numbering and handling article number rollover
#54835
Author: Curt Welch
Date: Sat, 27 Oct 2001 18:34
21 lines
2264 bytes
Howard Siegel <not.interested@nospam.invalid> wrote:
> To the folks who suggested just using NEWNEWS and only remember the
> date/time at whichit was done rather than trying to track article
> numbers... Thanks.  I'd been thinking too much along the lines of
> a standard client type program to see the forest for the trees in
> this instance.  I'll give it a try.

NEWNEWS in theory is just what you need if you intend to processes
all new articles every time you connect.  But in practice, NEWNEWS
doesn't work on very many servers, so it's not a good overall soultion
the the problem.  However, if you only need your application to
work on a single server, and that server does support NEWNEWS,
then you will be in business.

If you want a general solution to work on all servers, you need to
deal with the article number issues.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Re: Article numbering and handling article number rollover
#54852
Author: Howard Siegel
Date: Mon, 29 Oct 2001 08:58
24 lines
2131 bytes
curt@kcwc.com writes:
> NEWNEWS in theory is just what you need if you intend to processes
> all new articles every time you connect.  But in practice, NEWNEWS
> doesn't work on very many servers, so it's not a good overall soultion
> the the problem.  However, if you only need your application to
> work on a single server, and that server does support NEWNEWS,
> then you will be in business.
> 
> If you want a general solution to work on all servers, you need to
> deal with the article number issues.

Well, for the time being, I'll use NEWNEWS as it does seem to be
supported and working with our current NNTP server.  When we have
to move on to another NNTP server, if it does not support NEWNEWS,
my program will stop working and I'll have to revamp it then.  But
I don't expect that to happen for a decent amount of time (at least
6 months or a year).

- howard
-- 

-- 
Netcom Class of '93, RIP Netcom!     <*>     hsiegel<->at<->pobox<->dot<->com
Re: Article numbering and handling article number rollover
#54853
Author: Jim Crowther
Date: Mon, 29 Oct 2001 11:11
18 lines
1975 bytes
In message <9rj5nq$br$1@news.panix.com>, Howard Siegel 
<not.interested@nospam.invalid> writes

>Well, for the time being, I'll use NEWNEWS as it does seem to be 
>supported and working with our current NNTP server.  When we have to 
>move on to another NNTP server, if it does not support NEWNEWS, my 
>program will stop working and I'll have to revamp it then.  But I don't 
>expect that to happen for a decent amount of time (at least 6 months or 
>a year).

Let us know how you get on. :)

-- 
Jim Crowther                 "It's MY computer" �
<http://pchelpers.org>
<http://website.lineone.net/~legal.defence.fund/>
Key ID 0xC56DD45F (DH/DSS 2048/1024)
Re: Article numbering and handling article number rollover
#54972
Author: Howard Siegel
Date: Mon, 05 Nov 2001 07:08
71 lines
4650 bytes
jim@crowfam.org.uk writes:
> In message <9rj5nq$br$1@news.panix.com>, Howard Siegel 
> >Well, for the time being, I'll use NEWNEWS as it does seem to be 
> >supported and working with our current NNTP server.  When we have to 
> >move on to another NNTP server, if it does not support NEWNEWS, my 
> >program will stop working and I'll have to revamp it then.  But I don't 
> >expect that to happen for a decent amount of time (at least 6 months or 
> >a year).
> 
> Let us know how you get on. :)

Guess it's time to lay my cards on the table.....

The application is a News to Mail gateway and the implementation
platform is an Alpha running VMS.  We have a conferencing system
in DEC/Notes to which we post selected articles from News.  The
articles were originally being forward via mail from an old "C"
news system and the infrastructure was already in place to handle
the automated conversion from mail to the Notes system.

However, the old Unix system we were using was becoming flakey
and was decommisioned when our Alpha was moved to a new facility.
Since the new facility was donating space, power, cooling, net
connectivity, etc., it didn't seem right to impose on them any
more.  Plus, we have no budget to buy any new h/w to put up our
own news server, nor the desire to install or manage one even
if the h/w was donated. The Alpha/VMS host system has plenty of
cycles to spare and we already have access to the News server
via the host facility.

I could have grabbed a variety of programs off the net to do
the News to Mail gateway, but they were pretty much all overkill
for what we needed or would have required work to make them
buildable/runnable on VMS.  Instead I opted to build a new,
minimalist, news to mail gateway NNTP client program in perl
using an existing NNTP interface package to connect to the news
server.

The perl program I wrote is about 100 lines long.  This includes
newsrc file maintenance and a decent amount of error checking (I
always write pretty defensive code).  The newsrc file consists of
the group name and the gmt time at which it was last read.  I do
a NEWNEWS command using that time, set the last read time to the
time immediately following the NEWNEWS command, then process the
list of message id's, grabbing each article, writing it to a file,
and e-mailing said file in to the account from which it is posted
to the Notes conference.  I keep the message id's so that as I
process each news group, if the article was cross posted, the
message id will already have been seen and I won't reprocess the
article (though I do not keep the message id list between runs).
And, no article numbers to worry about!

Right now the process is manual (I run the perl program from the
command line every now and then), and it has been in use now for
a bit more than a week with no problems.  Eventually, after I
tweak the perl program a little bit more, I will wrap the it in
a DCL command procedure that will run as a batch job which will
resubmit itself every few hours, and send me e-mail when something
goes wrong.

So, I may have reinvented the wheel here, but it was a very small
wheel and I learned a bunch of perl in the process.  And the result
has a lot fewer moving parts than if we put up a new news server
or used some of the other software available from the nets.

- howard
-- 

-- 
Netcom Class of '93, RIP Netcom!     <*>     hsiegel<->at<->pobox<->dot<->com
Re: Article numbering and handling article number rollover
#54973
Author: Andrew Gierth
Date: Mon, 05 Nov 2001 07:24
29 lines
2521 bytes
>>>>> "Howard" == Howard Siegel <not.interested@nospam.invalid> writes:

 Howard> The perl program I wrote is about 100 lines long.  This
 Howard> includes newsrc file maintenance and a decent amount of error
 Howard> checking (I always write pretty defensive code).  The newsrc
 Howard> file consists of the group name and the gmt time at which it
 Howard> was last read.  I do a NEWNEWS command using that time, set
 Howard> the last read time to the time immediately following the
 Howard> NEWNEWS command, then process the list of message id's,

The right way to do this is:

use the DATE command on the server to get the current time, record
that for the next pass.

use the time from the previous run, preferably wound back a few
minutes, for doing one or more NEWNEWS commands (you can specify lots
of groups at one go, provided you keep the command length down to the
510-byte limit). Take the resulting list of message-ids, remove any
duplicates, and remove any that correspond to articles that you
already have seen recently. Then fetch the articles.

(Not keeping at least a small history between runs will always lead
to the possibility of either missing or duplicating the occasional
article.)

-- 
Andrew.
Re: Article numbering and handling article number rollover
#54975
Author: Howard Siegel
Date: Mon, 05 Nov 2001 15:44
31 lines
2261 bytes
andrew@erlenstar.demon.co.uk writes:
> The right way to do this is:
> 
> use the DATE command on the server to get the current time, record
> that for the next pass.
> 
> use the time from the previous run, preferably wound back a few
> minutes, for doing one or more NEWNEWS commands (you can specify lots
> of groups at one go, provided you keep the command length down to the
> 510-byte limit). Take the resulting list of message-ids, remove any
> duplicates, and remove any that correspond to articles that you
> already have seen recently. Then fetch the articles.

Sounds good.

> (Not keeping at least a small history between runs will always lead
> to the possibility of either missing or duplicating the occasional
> article.)

The occasional missed/duplicate article is not all that critical at
this time.

I had thought about setting the times so that there would be some
overlap so as not to miss any articles and then keeping the history
between runs to weed out the duplicates.  Just haven't implemented
it as yet.
-- 

-- 
Netcom Class of '93, RIP Netcom!     <*>     hsiegel<->at<->pobox<->dot<->com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads