Skip to content

fix(asyncio): Fix behaviour with misbehaving storage devices#1453

Merged
tdewey-rpi merged 3 commits into
mainfrom
dev/tdewey/resource-stall-mitigations
Jan 15, 2026
Merged

fix(asyncio): Fix behaviour with misbehaving storage devices#1453
tdewey-rpi merged 3 commits into
mainfrom
dev/tdewey/resource-stall-mitigations

Conversation

@tdewey-rpi

Copy link
Copy Markdown
Collaborator

No description provided.

- Added new recovery events to the ImagingCycle class, including 'hardTimeout'.
- Implemented print_recovery_events function to summarize recovery actions during writes.
- Updated print_cycles and print_pipeline_analysis functions to include recovery event types.
- Introduced WriteProgressWatchdog to monitor write progress and detect stalls, with recovery strategies for async I/O.
- Enhanced file operations across platforms to support queue depth reduction and sync fallback mechanisms.
- Improved memory management and timeout utilities for better handling of stalled operations.

This update aims to improve the robustness of the write process by providing better diagnostics and recovery options for slow or unresponsive devices.
…ing and thread safety

- Added handling for kTimeout error in ConvertFileError function to enhance error reporting.
- Changed _cancelled member in DownloadThread to std::atomic<bool> for safe access across threads.
- Updated runWithTimeout function to include a type trait check, ensuring compatibility with non-void return types.
…ites across platforms

- Updated the WaitForPendingWrites function in Linux, macOS, and Windows implementations to unify timeout logic.
- Introduced a 5-minute emergency timeout as a fallback for stalled operations, enhancing robustness.
- Adjusted logging to provide clearer information during emergency timeout scenarios.
- Removed adaptive queue depth reduction logic to simplify the handling of pending writes.
@tdewey-rpi tdewey-rpi merged commit 4a95ae0 into main Jan 15, 2026
@tdewey-rpi tdewey-rpi deleted the dev/tdewey/resource-stall-mitigations branch January 21, 2026 16: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.

[BUG]: BLKDISCARD timeout is too aggressive for slow cards [BUG]: Stop writing without error

1 participant