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

Fix EOF Crash in JANA2 Event Sources (#834) #836

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

RaiqaRasool
Copy link

Description:

This PR addresses the crash occurring at the end of REST file processing in JANA2 event sources, as detailed in issue #834. The root cause was the outdated exception handling mechanism inherited from JANA1, where reaching the end of a file would throw an exception to indicate that all events had been processed. In case of JANA1, it was getting perceived as a signal of no more events if exception thrown was RETURN_STATUS::kNO_MORE_EVENTS but no more in JANA2 that's why it was not crashing with JANA1 but now in JANA2 it is. Ideally also it's not good to throw any kind of exception just to end things. That's why JANA2 introduced an Emit function that returns Result enums properly indicating end instead of throwing exception approach.

Key Changes:

  • Replaced the GetEvent function from JANA1 with the Emit function from JANA2 across all event sources.
  • Added SetCallbackStyle(CallbackStyle::ExpertMode) in the constructors of all event sources to ensure that exceptions are no longer used for event handling.
  • Updated all no more events signal to use the Result::FailureFinished enum, ensuring that reaching the no more events to process stage does not trigger an exception and crash.

Testing:

  • Verified that all event sources now handle EOF correctly without crashing.
  • Ran tests with REST file to ensure stability and correctness.

Impact:

  • Users should no longer experience crashes when processing files that reach their end.
  • No changes were made to the JANA2 codebase; only event sources in halld_recon were updated.

Fixes:

@RaiqaRasool RaiqaRasool requested a review from aaust August 30, 2024 20:39
@gluex
Copy link

gluex commented Aug 30, 2024

Build status for this pull request: FAILURE

Build log: /work/halld/pull_request_test/halld_recon^rasool_jana2_fix_eof_crash_834/make_rasool_jana2_fix_eof_crash_834.log
Build report: /work/halld/pull_request_test/halld_recon^rasool_jana2_fix_eof_crash_834/report_rasool_jana2_fix_eof_crash_834.txt
Location of build: /work/halld/pull_request_test/halld_recon^rasool_jana2_fix_eof_crash_834

@aaust
Copy link
Contributor

aaust commented Aug 30, 2024

Thank you. The test obviously fails because it uses jana1. I will build the branch separately and report.

@RaiqaRasool RaiqaRasool merged commit de1f003 into rasool_jana2 Oct 15, 2024
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.

3 participants