Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

flashers: make dhcp failure flash retryable#730

Merged
mangelajo merged 1 commit intojumpstarter-dev:mainfrom
bennyz:retryable-dhcp
Nov 4, 2025
Merged

flashers: make dhcp failure flash retryable#730
mangelajo merged 1 commit intojumpstarter-dev:mainfrom
bennyz:retryable-dhcp

Conversation

@bennyz
Copy link
Copy Markdown
Member

@bennyz bennyz commented Nov 4, 2025

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Enhanced error handling for DHCP setup failures, now enabling automatic retry attempts instead of immediate failure with improved error messaging for troubleshooting.

Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
@bennyz bennyz requested a review from mangelajo November 4, 2025 10:54
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 4, 2025

Deploy Preview for jumpstarter-docs ready!

Name Link
🔨 Latest commit 464592b
🔍 Latest deploy log https://app.netlify.com/projects/jumpstarter-docs/deploys/6909db542abe770008197c34
😎 Deploy Preview https://deploy-preview-730--jumpstarter-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 4, 2025

Walkthrough

A try/except block was added around DHCP setup in the flasher driver's context manager to convert RuntimeError and ValueError exceptions into FlashRetryableError instances, providing better error classification and context for retry logic.

Changes

Cohort / File(s) Change Summary
DHCP Error Handling
packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py
Added try/except wrapper around DHCP setup to convert RuntimeError or ValueError into FlashRetryableError with informative message

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Focus area: Error handling logic and exception translation semantics in the _busybox context manager
  • Verify: FlashRetryableError usage is consistent with retry framework patterns and error messaging is clear for debugging

Possibly related PRs

  • jumpstarter-dev/jumpstarter#696: Introduces FlashRetryableError centralization for retry handling, which this change directly leverages for DHCP failure classification.

Suggested reviewers

  • kirkbrauer

Poem

🐰✨ When DHCP stumbles and fails its dance,
A rabbit wraps the error with a second chance,
FlashRetryable, so wise and bright,
Transforms the chaos into light! 🌟

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: converting DHCP failures into retryable flash errors in the flashers module.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca77ec1 and 464592b.

📒 Files selected for processing (1)
  • packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-01-29T11:52:43.554Z
Learnt from: bennyz
Repo: jumpstarter-dev/jumpstarter PR: 241
File: packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/client.py:52-60
Timestamp: 2025-01-29T11:52:43.554Z
Learning: The TFTP driver (packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/driver.py) handles all low-level concerns like path validation, error handling, and checksum computation. The client (packages/jumpstarter-driver-tftp/jumpstarter_driver_tftp/client.py) should remain simple as it delegates these responsibilities to the driver.

Applied to files:

  • packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py
🧬 Code graph analysis (1)
packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py (1)
packages/jumpstarter-driver-uboot/jumpstarter_driver_uboot/client.py (1)
  • setup_dhcp (112-131)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Redirect rules - jumpstarter-docs
  • GitHub Check: Header rules - jumpstarter-docs
  • GitHub Check: Pages changed - jumpstarter-docs
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.11)
  • GitHub Check: pytest-matrix (macos-15, 3.11)
  • GitHub Check: pytest-matrix (macos-15, 3.13)
  • GitHub Check: pytest-matrix (macos-15, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.12)
  • GitHub Check: pytest-matrix (ubuntu-24.04, 3.13)
  • GitHub Check: e2e
🔇 Additional comments (1)
packages/jumpstarter-driver-flashers/jumpstarter_driver_flashers/client.py (1)

831-834: LGTM! DHCP failure handling is correctly implemented.

The try/except block appropriately converts DHCP setup failures into FlashRetryableError, enabling the retry logic to handle transient network issues. The exception types caught (RuntimeError and ValueError) match what setup_dhcp() can raise, and the exception chaining with from e preserves the original context.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member

@mangelajo mangelajo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! that was quick! :D

@mangelajo mangelajo merged commit 6d88da4 into jumpstarter-dev:main Nov 4, 2025
18 checks passed
@jumpstarter-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for release-0.7:

@jumpstarter-backport-bot
Copy link
Copy Markdown

Git push to origin failed for release-0.7 with exitcode 1

@bennyz bennyz deleted the retryable-dhcp branch November 4, 2025 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants