Skip to content

feat: add retry logic for normalization errors - BED-10545 - #123

Merged
mykeelium merged 2 commits into
mainfrom
mcuomo/BED-10543
Nov 23, 2026
Merged

mykeelium merged 2 commits into
mainfrom
mcuomo/BED-10543

Conversation

@mykeelium

@mykeelium mykeelium commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Adds a check for a normalization error that may occur, and attempt to lower the resources in a response to a possible OOM error that is occuring. This is a gaurded retry for a simple collection.


Stack created with GitHub Stacks CLI • Give Feedback 💬

Summary by CodeRabbit

  • New Features
    • Conversion jobs can now recover from certain normalization worker failures by retrying once with a single worker and resuming saved packages, without recollecting or re-extracting data.
  • Documentation
    • Added guidance on recovery behavior, limitations, and what happens when recovery fails.

@mykeelium
mykeelium added this pull request to stack #127 November 17, 2026 19:35
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The converter now retries eligible normalization worker-pool failures by resuming retained packages with one worker. The recovery helper validates pending packages, restores worker configuration, and loads the result. Tests and documentation cover the fallback and its limits.

Changes

Normalization Recovery

Layer / File(s) Summary
Recovery eligibility and resume helper
src/openhound/core/recovery.py, tests/test_pipeline_recovery.py
The helper checks whether a normalization failure is retryable and resumes extracted or normalized packages. It restores the prior worker configuration and raises when validation or loading fails. Tests cover eligibility, pending-package requirements, and worker counts.
Converter fallback and validation
src/openhound/core/convert.py, src/openhound/core/pipeline.py, tests/test_pipeline_recovery.py, .github/workflows/test.yml, docs/cli-tools.md
Converter enables the fallback, and BasePipeline._run invokes it for eligible failures using one normalization worker. Tests cover fallback outcomes and retained package state. The workflow runs the recovery tests, and the documentation describes recovery behavior and limitations.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Converter
  participant BasePipelineRun as BasePipeline._run
  participant RetryCheck as can_retry_normalization
  participant Resume as resume_pending_pipeline
  participant DltPipeline
  Converter->>BasePipelineRun: Pass pipeline step failure
  BasePipelineRun->>RetryCheck: Check failure eligibility
  RetryCheck-->>BasePipelineRun: Return eligibility result
  BasePipelineRun->>Resume: Resume with one normalization worker
  Resume->>DltPipeline: Normalize pending extracted packages
  Resume->>DltPipeline: Load pending packages
Loading

Possibly related PRs

  • SpecterOps/OpenHound#124: Adds a command to resume normalization from saved collection data, which may share the retained-package resume behavior.

Suggested reviewers: jplarose, strandutton

Merge Risk: Minimal · up to 3e142

Converter jobs that hit a normalization worker-pool failure now retry once with a single worker instead of failing outright. Other pipelines behave as before. The changes are tested and documented, and no merge-blocking risk was identified.

Architecture risk: Low · up to 3e142

The change affects 3 systems.

Changed systems: src, docs, tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 3 changed files map to changed impact.
  • observed — docs (service) was modified; 1 changed file maps to changed impact.
  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/openhound/core/convert.py: Converter adds the _retry_normalization_worker_failure class attribute with a value of True.
  • observed — Modified behavior in src/openhound/core/pipeline.py: Adds the cast import.
  • observed — Modified behavior in src/openhound/core/pipeline.py: Imports can_retry_normalization and resume_pending_pipeline for normalization failure detection and recovery.
  • observed — Modified behavior in src/openhound/core/pipeline.py: Adds the _retry_normalization_worker_failure class attribute, defaulting to False.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: adding retry logic for normalization errors. The changeset adds a single-worker fallback for DLT normalization failures caused by BrokenProcessPool, with recovery help…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: adding retry logic for normalization errors. The changeset adds a single-worker fallback for DLT normalization failures caused by BrokenProcessPool, with recovery helpers, tests, and docs. The title is specific and matches the primary change. It does not name the narrow BrokenProcessPool trigger, which is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the worker pool,
Then finds the saved packages still.
One worker starts the task anew,
The pending rows come hopping through.
The source stays quiet; logs record the way.
I nibble carrots and call it a day.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ab0603b-f5f7-4c74-82c7-00bed1c3ae61
Commits

Reviewing files that changed from the base of the PR and between 0120b26 and 3e142c5.

Files selected for processing: 1

  • docs/cli-tools.md

Included review availability: This review used your included allowance. 7 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

@StranDutton StranDutton added the enhancement New feature or request label Nov 18, 2026
Comment thread README.md Resolved
@mykeelium
mykeelium merged commit ff28168 into main Nov 23, 2026
2 checks passed
@mykeelium
mykeelium deleted the mcuomo/BED-10543 branch November 23, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants