EPrints Technical Mailing List Archive

See the EPrints wiki for instructions on how to join this mailing list and related information.

Message: #05726


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Event Queue 'Bug' ?


Having been playing around with event queue stuff over the last week or so, I think I’ve found an issue.

 

In https://github.com/eprints/eprints/blob/3.3/perl_lib/EPrints/DataObj/EventQueue.pm#L290  through to 296 it appears to be trying to assign the eval error message (i.e. a ’die’ message from an event function) to the description field of the event queue, but this was never appearing in the database.  After playing around with some debug messages it appears as though the $@ variable is getting reset, probably in the call to $self->message on line 293 (for the indexer log), so has no value when it gets passed to the set_value on 294.

 

By amending it as follows I’ve now got a somewhat useful and visible message in the Event Queue against the failed job.  Does anyone think this is a bad / good idea?  Should I raise it as an issue or even commit the fix?

290:        my $rc = eval { $plugin->$action( @params ) };

291:        if( $@ )

292:        {

+++                        my $eval_error = $@;  # save the value of the eval error message

293:                        $self->message( "error", $xml->create_text_node( "Error during execution: $@" ) );

294: ---                  $self->set_value( "description", $@ );

+++ 294:               $self->set_value( “description”, $eval_error );

295:                        return EPrints::Const::HTTP_INTERNAL_SERVER_ERROR;

296         }

 

 

 

Cheers,

Alan Stiles

Digital Repository Developer

Library Services, The Open University

oro.open.ac.uk

 

-- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority.