Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saver exception handling #160

Merged

Conversation

JelleAalbers
Copy link
Member

This makes strax crash if an exception occurs while saving data. Previously such exceptions could only be recovered from the metadata of the data type whose saver crashed, since the strax processing command itself just succeeded.

  • An exception in the saver now gets thrown inside the mailbox it is reading from. This will kill now the mailbox, which as before brings down the whole processing and reraises the original exception at the end.
  • When the exception occurs at the very end of processing, this isn't enough, since Mailbox._read passes beyond the logic capable of handling exceptions when the last message is delivered. Thus, we also store the exception in a new attribute got_exception of the saver. At the end of processing, we check if any of the savers have this attribute set, and if so, throw the original exception. This would have been sufficient on its own, but it's nicer to report the error and stop processing as soon as the first exception occurs, rather than at the very end.

This also adds a test to ensure this behaviour. For ParallelSourcePlugin-inlined savers, this exception handling likely does not work and will require more complicated logic.

@JelleAalbers JelleAalbers merged commit f248f96 into AxFoundation:master May 10, 2019
@JelleAalbers JelleAalbers deleted the saver_exception_handling branch May 10, 2019 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant