Skip to content

BFD-4841: Improve IDR Pipeline error handling - #3244

Merged
malessi merged 14 commits into
masterfrom
alessio/BFD-4841__fix-exception-handling
Aug 12, 2026
Merged

BFD-4841: Improve IDR Pipeline error handling#3244
malessi merged 14 commits into
masterfrom
alessio/BFD-4841__fix-exception-handling

Conversation

@malessi

@malessi malessi commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

JIRA Ticket:
BFD-4841

What Does This PR Do?

This PR fixes a variety of issues with the way the IDR Pipeline manages unhandled Exceptions between background/subprocess workers (e.g. LoadingBatchWorker or any of the ParallelStageExecutor jobs).

The most notable improvements are:

  • All Exceptions retain their full context and stack trace regardless of which process they were raised in allowing us to more easily see where an unhandled error occurred
    • This may seem strange as why wouldn't an Exception not have all of its context? This occurred because Exception "tracebacks" (a.k.a stack traces) are not preserved when an Exception is "pickled" (serialized) across processes. We now do this serialization manually using tblib, so all context is preserved
  • Extraneous noise caused when sibling processes are forcibly stopped by raiseing Exceptions in a signal handler has been suppressed making it much easier to see the real Exception in the logs
  • Exceptions raised when extracting/loading a table/BaseModel-derived model are now wrapped by a custom Exception that is explicit about which table failed to load

Altogether, the error handling is significantly improved and we should be able to determine the cause of issues much more easily.

What Should Reviewers Watch For?

If you're reviewing this PR, please check for these things in particular:

  • See above

What Security Implications Does This PR Have?

Please indicate if this PR does any of the following:

  • Adds any new software dependencies

    • Yes, tblib. I will not merge until @sb-benohe approves.
  • Modifies any security controls

  • Adds new transmission or storage of data

  • Any other changes that could possibly affect security?

  • I have considered the above security implications as it relates to this PR. (If one or more of the above apply, it cannot be merged without the ISSO or team security engineer's (@sb-benohe) approval.)

  • I have created tests to sufficiently ensure the reliability of my code, if applicable. If this is a modification to an existing piece of code, I have audited the associated tests to ensure everything works as expected.

Validation

Have you fully verified and tested these changes? Is the acceptance criteria met? Please provide reproducible testing instructions, code snippets, or screenshots as applicable.

  • raiseing various Exceptions in multiple different parts of the IDR Pipeline that run in subprocesses, validating that:
    • The full stack trace and Exception context is logged upon exit
    • No extraneous noise from the subprocess stopping is logged
    • The IDR Pipeline exits completely and near-immediately, as expected

Comment thread apps/bfd-pipeline-idr/src/idr_pipeline/batch_worker.py
@malessi
malessi force-pushed the alessio/BFD-4841__fix-exception-handling branch from dfe255a to 1c8e8f1 Compare August 5, 2026 19:16
Base automatically changed from alessio/BFD-4576__autorun-idr-validator to master August 5, 2026 19:35
@malessi
malessi force-pushed the alessio/BFD-4841__fix-exception-handling branch from 1c8e8f1 to acb4779 Compare August 5, 2026 20:50
@malessi
malessi marked this pull request as ready for review August 5, 2026 21:00
@malessi
malessi requested a review from sb-benohe August 5, 2026 21:00
Comment thread apps/bfd-pipeline-idr/src/idr_pipeline/exception_utils.py
@bfd-sast

bfd-sast Bot commented Aug 6, 2026

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed for 'bfd-parent'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@malessi
malessi enabled auto-merge August 7, 2026 15:01
@malessi
malessi added this pull request to the merge queue Aug 12, 2026
Merged via the queue into master with commit adae9a1 Aug 12, 2026
14 of 20 checks passed
@malessi
malessi deleted the alessio/BFD-4841__fix-exception-handling branch August 12, 2026 17:23
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