🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
11 messages
11 total messages Started by D. Stussy Thu, 13 Nov 2008 07:28
INN's "news.daily" script.
#79640
Author: D. Stussy
Date: Thu, 13 Nov 2008 07:28
14 lines
1729 bytes
I have found that due to other things happening on my machine, the
message-expire part of this script sometimes gets killed (for out-of-memory
reasons).  The problem is that when this script eventually finishes, the
news server still has a "reserved" status (although put back to running
mode - not left throttled).  This means that when it is run for the next
day's cycle, no article expiration takes place.

Fixing this by adding a 'ctlinnd reserve ""' to the end of the script (I put
it just before the "${RNEWS} -U" line) is suggested.  Comments?

There might be a better location in the file to put this (when multiple
versions of the script are running), but I didn't look for such.

Re: INN's "news.daily" script.
#79641
Author: D. Stussy
Date: Thu, 13 Nov 2008 22:30
12 lines
1508 bytes
"D. Stussy" <spam@bde-arc.ampr.org> wrote in message
news:gfgkvd$o22$1@snarked.org...
> ...
> There might be a better location in the file to put this (when multiple
> versions of the script are running), but I didn't look for such.

I think I found a better place:

There is only one instance of "ctlinnd go" in the script.  Therefore,
putting this on the line before is probably a better place.

Re: INN's "news.daily" script.
#79664
Author: Julien ÉLIE
Date: Tue, 18 Nov 2008 10:58
32 lines
2241 bytes
Hi D. Stussy,

>> There might be a better location in the file to put this (when multiple
>> versions of the script are running), but I didn't look for such.
>
> There is only one instance of "ctlinnd go" in the script.  Therefore,
> putting this on the line before is probably a better place.

Index: news.daily.in
===================================================================
--- news.daily.in       (révision 8162)
+++ news.daily.in       (copie de travail)
@@ -385,6 +385,9 @@
 ${DORM} &&
     find ${TEMPSOCKDIR} -name "${TEMPSOCK}" -mtime +2 -exec rm -f '{}' ';'

+##  Remove the possible reserve mode (in case expire was killed).
+ctlinnd -s reserve "" 2>/dev/null
+
 ##  Did we become throttled during the run?
 SERVERMODE=`ctlinnd mode 2>/dev/null | ${SED} 1q`
 case "${SERVERMODE}" in



Thanks for having pointed this issue out.

-- 
Julien ÉLIE

« Accusare nemo se debet nisi coram Deo. »
Re: INN's "news.daily" script.
#79676
Author: D. Stussy
Date: Wed, 19 Nov 2008 01:02
38 lines
2786 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message news:gfu75v$3lg$1@news.trigofacile.com...
> Hi D. Stussy,
>
> >> There might be a better location in the file to put this (when multiple
> >> versions of the script are running), but I didn't look for such.
> >
> > There is only one instance of "ctlinnd go" in the script.  Therefore,
> > putting this on the line before is probably a better place.

Note:  After I posted that, I noted one instance of "expire" that was killed due to being unable to allocate memory to read the
history file, and that position did not un-reserve the server.

Maybe the best way would be to read the mode status after expiring (which is included in the e-mail sent to the admin) and check it
for a [still] reserved status.  This means un-reserving the server only if we find it's "our" reserved string that's in the mode
status report -- in case multiple copies of the script are running.

> Index: news.daily.in
> ===================================================================
> --- news.daily.in       (révision 8162)
> +++ news.daily.in       (copie de travail)
> @@ -385,6 +385,9 @@
>  ${DORM} &&
>      find ${TEMPSOCKDIR} -name "${TEMPSOCK}" -mtime +2 -exec rm -f '{}' ';'
>
> +##  Remove the possible reserve mode (in case expire was killed).
> +ctlinnd -s reserve "" 2>/dev/null
> +
>  ##  Did we become throttled during the run?
>  SERVERMODE=`ctlinnd mode 2>/dev/null | ${SED} 1q`
>  case "${SERVERMODE}" in
>
>
>
> Thanks for having pointed this issue out.

Still an issue.  Placement of the function is the problem.

Re: INN's "news.daily" script.
#79690
Author: Julien ÉLIE
Date: Wed, 19 Nov 2008 11:37
42 lines
2802 bytes
Hi D. Stussy,

> This means un-reserving the server only if we find it's "our" reserved string that's in the mode
> status report -- in case multiple copies of the script are running.
>
>> Index: news.daily.in
>> ===================================================================
>> --- news.daily.in       (révision 8162)
>> +++ news.daily.in       (copie de travail)
>> @@ -385,6 +385,9 @@
>>  ${DORM} &&
>>      find ${TEMPSOCKDIR} -name "${TEMPSOCK}" -mtime +2 -exec rm -f '{}' ';'
>>
>> +##  Remove the possible reserve mode (in case expire was killed).
>> +ctlinnd -s reserve "" 2>/dev/null
>> +
>>  ##  Did we become throttled during the run?
>>  SERVERMODE=`ctlinnd mode 2>/dev/null | ${SED} 1q`
>>  case "${SERVERMODE}" in
>>
>
> Still an issue.  Placement of the function is the problem.

Why the placement?  Expire is finished at the time this "ctlinnd reserve" call is made.
Afterwards, it is expireover, renumbering and innstat (which generates the status you
spoke about).  Do you want to wait for the end of expireover and renumbering?  Why?

Suggestion:

if (ctlinnd mode | grep "Reserved ${REASON}" > /dev/null) ; then
  ctlinnd -s reserve "" 2>/dev/null
fi

Or do you want something else?
${REASON} contains the exact reserve string used by *this* instance of news.daily
(and expire).

-- 
Julien ÉLIE

« Une coupe pour trois ? Vous êtes calédoniens je présume ? » (Astérix) 
Re: INN's "news.daily" script.
#79699
Author: D. Stussy
Date: Wed, 19 Nov 2008 23:56
43 lines
3070 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message news:gg0tq5$i67$1@news.trigofacile.com...
> > This means un-reserving the server only if we find it's "our" reserved string that's in the mode
> > status report -- in case multiple copies of the script are running.
> >
> >> Index: news.daily.in
> >> ===================================================================
> >> --- news.daily.in       (révision 8162)
> >> +++ news.daily.in       (copie de travail)
> >> @@ -385,6 +385,9 @@
> >>  ${DORM} &&
> >>      find ${TEMPSOCKDIR} -name "${TEMPSOCK}" -mtime +2 -exec rm -f '{}' ';'
> >>
> >> +##  Remove the possible reserve mode (in case expire was killed).
> >> +ctlinnd -s reserve "" 2>/dev/null
> >> +
> >>  ##  Did we become throttled during the run?
> >>  SERVERMODE=`ctlinnd mode 2>/dev/null | ${SED} 1q`
> >>  case "${SERVERMODE}" in
> >>
> >
> > Still an issue.  Placement of the function is the problem.
>
> Why the placement?  Expire is finished at the time this "ctlinnd reserve" call is made.
> Afterwards, it is expireover, renumbering and innstat (which generates the status you
> spoke about).  Do you want to wait for the end of expireover and renumbering?  Why?

That's not the problem.  It should be in a place where it cannot be bypassed (except by the check for its own reason, below).

My first thought was to put it at the end of the file.  However, it could be released earlier.  My second thought was to put it next
to the "go" control (inside the go's if clause).  However, it got bypassed on errors that don't cause go to be commanded.  If there
are any errors that use an exit, we might need this more than once.

> Suggestion:
>
> if (ctlinnd mode | grep "Reserved ${REASON}" > /dev/null) ; then
>   ctlinnd -s reserve "" 2>/dev/null
> fi
>
> Or do you want something else?

NO.  That's fine.

Re: INN's "news.daily" script.
#79701
Author: D. Stussy
Date: Thu, 20 Nov 2008 09:59
38 lines
2672 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:gg0tq5$i67$1@news.trigofacile.com...
> >> Index: news.daily.in
NOTE:  ADJUSTED for other comments.
> >> ===================================================================
> >> --- news.daily.in       (révision 8162)
> >> +++ news.daily.in       (copie de travail)
> >> @@ -385,6 +385,11 @@
> >>  ${DORM} &&
> >>      find ${TEMPSOCKDIR} -name "${TEMPSOCK}" -mtime +2 -exec rm -f
'{}' ';'
> >>
> >> +##  Remove the possible reserve mode (in case expire was killed).
> >> +if (ctlinnd mode | grep "Reserved ${REASON}" > /dev/null) ; then
> >> +    ctlinnd -s reserve "" 2>/dev/null
> >> +fi
> >> +
> >>  ##  Did we become throttled during the run?
> >>  SERVERMODE=`ctlinnd mode 2>/dev/null | ${SED} 1q`
> >>  case "${SERVERMODE}" in
> >
> > Still an issue.  Placement of the function is the problem.

I note that you're using a different version than was released with 2.4.5
(a 2.5.0 pre-release?).  However, the comment I have is the same.

Between the call to "expire" and this code, there do exist TWO "exit 1"
statements.  I believe those can exit with the server still throttled and
or reserved.  Are they properly accounted for?

Also noted, we don't have to have this code next to the "go" command.  We
can do this instead.  Go will only clear the reservation if it matches:

   ctlinnd -s go "${REASON}"

(Do we need the quotes, or does the REASON variable already have them?)

Re: INN's "news.daily" script.
#79708
Author: Julien ÉLIE
Date: Thu, 20 Nov 2008 15:43
30 lines
2226 bytes
Hi D. Stussy,

> I note that you're using a different version than was released with 2.4.5
> (a 2.5.0 pre-release?).

Yes.  I always use the lastest CURRENT version (that is to say a prerelease
version of INN 2.5.0).


> Between the call to "expire" and this code, there do exist TWO "exit 1"
> statements.  I believe those can exit with the server still throttled and
> or reserved.

You're right.  I have just adjusted the patch to take that into account.
It is now in CURRENT.


>   ctlinnd -s go "${REASON}"
>
> (Do we need the quotes, or does the REASON variable already have them?)

We need the quotes.

-- 
Julien ÉLIE

« Si bene commemini, causae sunt quinque bibendi :
  Hospitis aduentus, praesens sitis atque futura,
  Et uini bonitas, et quaelibet altera causa. » 
Re: INN's "news.daily" script.
#79713
Author: D. Stussy
Date: Thu, 20 Nov 2008 20:01
55 lines
3067 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:gg40jt$j0p$1@news.trigofacile.com...
> > I note that you're using a different version than was released with
2.4.5
> > (a 2.5.0 pre-release?).
>
> Yes.  I always use the lastest CURRENT version (that is to say a
prerelease
> version of INN 2.5.0).
>
> > Between the call to "expire" and this code, there do exist TWO "exit 1"
> > statements.  I believe those can exit with the server still throttled
and
> > or reserved.
>
> You're right.  I have just adjusted the patch to take that into account.
> It is now in CURRENT.
>
> >   ctlinnd -s go "${REASON}"
> >
> > (Do we need the quotes, or does the REASON variable already have them?)
>
> We need the quotes.

Here's why this is needed - last night's maintenance e-mail (snipped).  It
happened again:

"...
Expire messages:
expire begin Thu Nov 20 00:03:28 PST 2008: (-v1 -z/news/log/expire.rm)
    expire: failed to malloc 183556800 bytes at dbz.c line 1282: Cannot
allocate memory
expire end Thu Nov 20 00:03:31 PST 2008
...
Post expiration status:
...
Parameters c 30 i 512 (48) l 262144 o 1011 t 300 H 2 T 60 X 0 normal
specified
Reserved Expiring process 22787
Readers follow enabled
..."

==>  Expire aborted and the server is still reserved!  (Not reserved prior
to expiring).

175MB (17%) of ram isn't a trivial usage, either.  The machine has 1GB
(1,007MB usable by Linux, and 996MB reported by "free -t" for services and
applications).  OK, so I could upgrade the hardware (new motherboard too as
1GB RAM is the max for the existing one), but I also believe that software
should be error tolerant.

Sometimes, it does manage to get the needed memory allocation and runs
normally.

Re: INN's "news.daily" script.
#79911
Author: Julien ÉLIE
Date: Sun, 21 Dec 2008 21:19
16 lines
1914 bytes
Hi D. Stussy,

> Here's why this is needed - last night's maintenance e-mail (snipped).  It
> happened again:
>
> Reserved Expiring process 22787

Has it happened again since then?
(Is the patch working for you?)

-- 
Julien ÉLIE

« La médecine est un métier dangereux. Ceux qui ne meurent pas
  peuvent vous faire un procès. » (Coluche) 
Re: INN's "news.daily" script.
#79915
Author: D. Stussy
Date: Sun, 21 Dec 2008 23:14
17 lines
1976 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:gimbtn$s9i$1@news.trigofacile.com...
> Hi D. Stussy,
> > Here's why this is needed - last night's maintenance e-mail
(snipped).  It
> > happened again:
> >
> > Reserved Expiring process 22787
>
> Has it happened again since then?
> (Is the patch working for you?)

When I had posted that, I don't think I had seen your patch yet.
Instead, I reduced my memory requirements by suspending/rescheduling
some other cron jobs that were competing.

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