Thread View: news.software.nntp
7 messages
7 total messages
Started by Aioe
Mon, 30 Mar 2020 09:31
Wrong output for GROUP/LISTGROUP commands
Author: Aioe
Date: Mon, 30 Mar 2020 09:31
Date: Mon, 30 Mar 2020 09:31
70 lines
2520 bytes
2520 bytes
With INN 2.5 *and* 2.6, if a message is cancelled by a control cancel message, GROUP and LISTGROUP (first line) output shows the cancelled article as still existent. Example: $ telnet localhost 119 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 200 control.aioe.org InterNetNews NNRP server INN 2.5.4 ready (posting ok) group local.test2 211 1 1 1 local.test2 listgroup local.test2 211 1 1 1 local.test2 . post 340 Ok, recommended message-ID <r5sdc6$1ls9$1@control.aioe.org> Newsgroups: local.test2 From: a@b.c Subject: test me pppp . 240 Article received <r5sdc6$1ls9$1@control.aioe.org> group local.test2 211 2 1 2 local.test2 listgroup local.test2 211 2 1 2 local.test2 2 . quit 205 Bye! Connection closed by foreign host. /////////////////////////////////////// $ telnet newsfeed.aioe.org 119 Trying 46.165.242.75... Connected to newsfeed.aioe.org. Escape character is '^]'. 200 aioe.org InterNetNews server INN 2.5.4 ready (transit mode) ihave <TRQyhqwhqhjq@control.aioe.org> 335 Send it Date: Mon, 30 Mar 20 11:18:07 +0200 (CET) References: <r5sdc6$1ls9$1@control.aioe.org> Subject: a SPAM cancel from aioe.org Lines: 7 X-Complaints-To: abuse@aioe.org Newsgroups: local.test2 Control: cancel <r5sdc6$1ls9$1@control.aioe.org> From: a@b.c Message-ID: <TRQyhqwhqhjq@control.aioe.org> Path: control.aioe.org!cyberspam!.POSTED!not-for-mail Xref: control.aioe.org control.cancel:1542908 cancel test . 235 Article transferred OK mode reader 200 nntp.aioe.org InterNetNews NNRP server INN 2.5.4 ready (posting ok) group local.test2 211 2 1 2 local.test2 listgroup 211 2 1 2 local.test2 . quit 205 Bye! Connection closed by foreign host.
Re: Wrong output for GROUP/LISTGROUP commands
Author: Julien ÉLIE
Date: Mon, 30 Mar 2020 17:49
Date: Mon, 30 Mar 2020 17:49
64 lines
3418 bytes
3418 bytes
Hi Paolo,
> With INN 2.5 *and* 2.6, if a message is cancelled by a control cancel
> message, GROUP and LISTGROUP (first line) output shows the cancelled
> article as still existent.
LISTGROUP correctly shows the cancelled article as inexistent in the
list of article numbers (lines after the response code).
> group local.test2
> 211 2 1 2 local.test2
Estimated count of articles: 2
Reported low watermark: 1
Reported high watermark: 2
This is a valid NNTP answer. The use case is article reinstatement.
Had the answer been "211 1 2 2 local.test2" or "211 0 3 2 local.test2",
reinstating the article would have been impossible (not RFC-compliant
because the reported low watermark MUST NOT decrease). For instance if
an article is cancelled whereas it should have not, and you decide to
reinstate it manually.
RFC 3977:
The set of articles in a group may change after the GROUP command is
carried out:
o Articles may be removed from the group.
o Articles may be reinstated in the group with the same article
number, but those articles MUST have numbers no less than the
reported low water mark (note that this is a reinstatement of the
previous article, not a new article reusing the number).
[...]
Except when the group is empty and all three numbers are zero,
whenever a subsequent GROUP command for the same newsgroup is issued,
either by the same client or a different client, the reported low
water mark in the response MUST be no less than that in any previous
response for that newsgroup in this session, and it SHOULD be no less
than that in any previous response for that newsgroup ever sent to
any client. Any failure to meet the latter condition SHOULD be
transient only.
[...]
Note that a previously valid article number MAY become invalid if the
article has been removed. A previously invalid article number MAY
become valid if the article has been reinstated, but this article
number MUST be no less than the reported low water mark for that
group.
I hope this explanation helps in understanding the 211 response code.
--
Julien ÉLIE
« Les trois journées de 1830 ont renversé 89. »
Re: Wrong output for GROUP/LISTGROUP commands
Author: Aioe
Date: Mon, 30 Mar 2020 20:29
Date: Mon, 30 Mar 2020 20:29
24 lines
2185 bytes
2185 bytes
Il Mon, 30 Mar 2020 19:49:29 +0200, Julien ÉLIE ha scritto: > This is a valid NNTP answer. The use case is article reinstatement. Had > the answer been "211 1 2 2 local.test2" or "211 0 3 2 local.test2", I'm not sure I understand the second field of group output should represent the number of articles in the group. It should be "0" if no articles are available. if the output of GROUP reports a number of articles greater than zero when there are none, a script could expect to find some article in the group so it will try to find it. This forces the script to do a useless job which is expensive even for the server just because the value provided by GROUP is unreliable. From my point of view, it does not matter which values the lowmark and the highmark assume, I am only interested in the number of messages in the group. Following the strategy used by INN, the only way to know how many messages there are in a group is to use the (X)OVER or LISTGROUP commands which produce a large amount of output data and are expensive for the server if the group has many articles. imho, if there are no articles in a group, that value must be zero. In any case, the value reported by GROUP should be equal to the number of lines of the LISTGROUP output after the banner and before the dot.
Re: Wrong output for GROUP/LISTGROUP commands
Author: Julien ÉLIE
Date: Mon, 30 Mar 2020 21:35
Date: Mon, 30 Mar 2020 21:35
76 lines
4390 bytes
4390 bytes
Hi Paolo,
>> This is a valid NNTP answer. The use case is article reinstatement. Had
>> the answer been "211 1 2 2 local.test2" or "211 0 3 2 local.test2",
>
> the second field of group output should represent the number of articles
> in the group. It should be "0" if no articles are available.
I understand your point.
The fact is that the first number is an *estimated* count. INN does not
track the exact count at every moment. Cancels notably are not taken
into account immediately in the count.
INN's strategy is the third one:
[RFC 3977]
If the group is empty, one of the following three situations will
occur. Clients MUST accept all three cases; servers MUST NOT
represent an empty group in any other way.
o The high water mark will be one less than the low water mark, and
the estimated article count will be zero. Servers SHOULD use this
method to show an empty group. This is the only time that the
high water mark can be less than the low water mark.
o All three numbers will be zero.
o The high water mark is greater than or equal to the low water
mark. The estimated article count might be zero or non-zero; if
it is non-zero, the same requirements apply as for a non-empty
group.
Also in old RFC 977:
The successful selection response will return the article numbers of
the first and last articles in the group, and an estimate of the
number of articles on file in the group. It is not necessary that
the estimate be correct, although that is helpful; it must only be
equal to or larger than the actual number of articles on file. (Some
implementations will actually count the number of articles on file.
Others will just subtract first article number from last to get an
estimate.)
> if the output of GROUP reports a number of articles greater than zero
> when there are none, a script could expect to find some article in the
> group so it will try to find it.
I bet a script is not supposed to expect that behaviour ("Clients MUST
accept all three cases").
> From my point of view, it does not matter which values the lowmark and
> the highmark assume, I am only interested in the number of messages in
> the group. Following the strategy used by INN, the only way to know how
> many messages there are in a group is to use the (X)OVER or LISTGROUP
> commands which produce a large amount of output data and are expensive
> for the server if the group has many articles.
> imho, if there are no articles in a group, that value must be zero. In any
> case, the value reported by GROUP should be equal to the number of lines
> of the LISTGROUP output after the banner and before the dot.
I perfectly understand you wish the "estimated count" were the "real
count". Nevertheless, that's not the case in NNTP. Some
implementations give the exact count, other don't. INN currently does
not. I don't know how other servers behave (but would happy to know if
other people have tested).
--
Julien ÉLIE
« Les trois journées de 1830 ont renversé 89. »
Re: Wrong output for GROUP/LISTGROUP commands
Author: Aioe
Date: Tue, 31 Mar 2020 09:15
Date: Tue, 31 Mar 2020 09:15
6 lines
1035 bytes
1035 bytes
Il Mon, 30 Mar 2020 23:35:18 +0200, Julien ÉLIE ha scritto: > INN's strategy is the third one: it's clear, now thank you
Re: Wrong output for GROUP/LISTGROUP commands
Author: Julien ÉLIE
Date: Wed, 01 Apr 2020 22:13
Date: Wed, 01 Apr 2020 22:13
32 lines
2504 bytes
2504 bytes
Hi Paolo, >> INN's strategy is the third one: > > it's clear, now > thank you Which does not mean INN cannot enhance its behaviour a little. In order not to decrease performance and to handle the case of empty groups better, what do you think about something like that: - add an inn.conf parameter like groupexactcount (defaulting to 50) - if the estimated count known by nnrpd when responding to GROUP or LISTGROUP commands is inferior or equal to groupexactcount, then nnrpd really counts the exact number of articles still present in the newsgroup, and gives that number - if groupexactcount is set to 0, then nnrpd will always give the estimated number (current behaviour) - if you want nnrpd to always give the exact count, then set groupexactcount to the maximum possible article number currently handled by nnrpd (2147483647) When giving the exact count, should exact low watermarks and high watermarks also be given? (or you don't mind if they do not correspond to existing articles) Should the result of LIST COUNTS also use that rule for counting? -- Julien ÉLIE « La chaîne du mariage est si lourde qu'il faut être deux pour la porter, souvent trois. » (Alexandre Dumas)
Re: Wrong output for GROUP/LISTGROUP commands
Author: Aioe
Date: Thu, 02 Apr 2020 11:33
Date: Thu, 02 Apr 2020 11:33
51 lines
3487 bytes
3487 bytes
Il Thu, 02 Apr 2020 00:13:09 +0200, Julien ÉLIE ha scritto: > - add an inn.conf parameter like groupexactcount (defaulting to 50) > - if the estimated count known by nnrpd when responding to GROUP or > LISTGROUP commands is inferior or equal to groupexactcount, then nnrpd > really counts the exact number of articles still present in the > newsgroup, and gives that number - if groupexactcount is set to 0, then > nnrpd will always give the estimated number (current behaviour) Since I am forced to stay at home because of the epidemic, I spent this morning doing some tests. The most common newsreaders do *not* seem to have troubles if the number of messages actually available in a group differs greatly from the value returned by group and listgroup. I have tried Pan and slrn (linux), Thunderbird (Linux and windows), Claws (linux and windows), Mesnews (windows) and none of them seem to have problems even if the difference between the output of GROUP and the real value is about thousands of messages. This makes the feature you propose useless apart from very specific cases. Since calculating the exact number of messages slows down nnrpd, perhaps it would be a better choice to insert that flag into the access structure in the reader.conf file. In this way, in the few cases where this feature is needed, it can only be activated for instances of nnrpd which serve scripts that need to know the exact value of articles available in a group. > - if you want nnrpd to always give the exact count, then set > groupexactcount to the maximum possible article number currently handled > by nnrpd (2147483647) this seems acceptable even if perhaps a more elegant solution would be better (example: groupexactcount "none", "always" or a number representing the maximum value of messages beyond which nnrpd provides an estimation) > > When giving the exact count, should exact low watermarks and high > watermarks also be given? (or you don't mind if they do not correspond > to existing articles) no, as long as all the messages available on the server are numbered between the low watermark and the high watermark, it is not necessary that the low watermark value represents the oldest available message and the high watermark the most recent. It would be a good feature but only if it doesn't slow down the server significantly. > Should the result of LIST COUNTS also use that rule for counting? yes, of course
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