You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by "Neubert, Joachim" <J....@zbw.eu> on 2022/02/18 09:08:35 UTC

How to check return values of Jena components

In my tdb create script, I have several steps (loading, text indexing etc.) building on each other, and I want the whole script to abort when an error occurs. Therefore, I've introduce return value checks like this:

# since output is piped to tee, the return value of the originating program
               # has to be considered
               set -o pipefail

$JENAROOT/bin/tdb2.xloader $XLOADER_OPTS --loc=/var/lib/fuseki/databases/temp $FILE 2>&1 | tee -a $LOG
               if [ $? -eq 0 ]
then
echo `date +"%Y-%m-%d %T"` finished loading $FILE >> $LOG
echo "" >> $LOG
else
echo `date +"%Y-%m-%d %T"` ABORTED >> $LOG
exit 1
fi

               # ...

               # text indexing

With tdb2.xloader as well as fuseki jena.textindexer, I got the ABORTED, though apparently all went well.

Probably I make a simple fault here, but I couldn't figure out.

Cheers, Joachim


AW: How to check return values of Jena components

Posted by "Neubert, Joachim" <J....@zbw.eu>.
Hi Andy, when I tried to reproduce the issue with a small file, all worked find, the return value is 0. I will now load GND, and see if it can be reproduced with with a larger file. Cheers, Joachim 

Build is
TDB:        VERSION: 4.5.0-SNAPSHOT
TDB:        BUILD_DATE: 2022-02-09T18:01:44Z

> -----Ursprüngliche Nachricht-----
> Von: Andy Seaborne <an...@apache.org>
> Gesendet: Freitag, 18. Februar 2022 15:47
> An: users@jena.apache.org
> Betreff: Re: How to check return values of Jena components
> 
> Hi Joachim,
> 
> Using the development build, I get a return code of 0 from xloader. (The
> release one is broken)
> 
> What return code are you getting back?
> 
> On 18/02/2022 09:08, Neubert, Joachim wrote:
> > In my tdb create script, I have several steps (loading, text indexing etc.)
> building on each other, and I want the whole script to abort when an error
> occurs. Therefore, I've introduce return value checks like this:
> >
> > # since output is piped to tee, the return value of the originating program
> >                 # has to be considered
> >                 set -o pipefail
> >
> > $JENAROOT/bin/tdb2.xloader $XLOADER_OPTS --
> loc=/var/lib/fuseki/databases/temp $FILE 2>&1 | tee -a $LOG
> >                 if [ $? -eq 0 ]
> > then
> > echo `date +"%Y-%m-%d %T"` finished loading $FILE >> $LOG echo "" >>
> > $LOG else echo `date +"%Y-%m-%d %T"` ABORTED >> $LOG
> 
> Anything else in the log?
> 
> > exit 1
> > fi
> >
> >                 # ...
> >
> >                 # text indexing
> >
> > With tdb2.xloader as well as fuseki jena.textindexer, I got the ABORTED,
> though apparently all went well.
> >
> > Probably I make a simple fault here, but I couldn't figure out.
> >
> > Cheers, Joachim
> >
> >

Re: How to check return values of Jena components

Posted by Andy Seaborne <an...@apache.org>.
Hi Joachim,

Using the development build, I get a return code of 0 from xloader. (The 
release one is broken)

What return code are you getting back?

On 18/02/2022 09:08, Neubert, Joachim wrote:
> In my tdb create script, I have several steps (loading, text indexing etc.) building on each other, and I want the whole script to abort when an error occurs. Therefore, I've introduce return value checks like this:
> 
> # since output is piped to tee, the return value of the originating program
>                 # has to be considered
>                 set -o pipefail
> 
> $JENAROOT/bin/tdb2.xloader $XLOADER_OPTS --loc=/var/lib/fuseki/databases/temp $FILE 2>&1 | tee -a $LOG
>                 if [ $? -eq 0 ]
> then
> echo `date +"%Y-%m-%d %T"` finished loading $FILE >> $LOG
> echo "" >> $LOG
> else
> echo `date +"%Y-%m-%d %T"` ABORTED >> $LOG

Anything else in the log?

> exit 1
> fi
> 
>                 # ...
> 
>                 # text indexing
> 
> With tdb2.xloader as well as fuseki jena.textindexer, I got the ABORTED, though apparently all went well.
> 
> Probably I make a simple fault here, but I couldn't figure out.
> 
> Cheers, Joachim
> 
>