Skip to content

(PTFE-3162) Fix volume delete for scaleway#712

Merged
matthiasL-scality merged 1 commit intomainfrom
PTFE-3162-fix-volume-delete
Apr 13, 2026
Merged

(PTFE-3162) Fix volume delete for scaleway#712
matthiasL-scality merged 1 commit intomainfrom
PTFE-3162-fix-volume-delete

Conversation

@matthiasL-scality
Copy link
Copy Markdown
Contributor

This pull request improves the reliability of deleting block storage volumes in the Scaleway backend by adding retry logic when volumes are temporarily stuck in the "in_use" state. It also adds comprehensive unit tests to ensure the new retry behavior works as expected in both success and failure scenarios.

Improvements to Scaleway block volume deletion:

  • Added exponential backoff retry logic to the delete method in scaleway.py so that if a block storage volume is still "in_use" or marked as a "protected_resource", the system will retry deletion up to five times with increasing wait times between attempts. This handles cases where Scaleway takes time to detach volumes after server deletion. [1] [2]
  • Ensured that if all retries are exhausted and the volume still cannot be deleted, an appropriate warning is logged and the process continues gracefully. [1] [2]

Testing enhancements:

  • Added test_delete_volume_in_use_retry_succeeds to verify that the retry logic successfully deletes a volume after temporary "in_use" errors.
  • Added test_delete_volume_in_use_retry_exhausted to verify that a warning is logged and the correct result is returned if the volume remains "in_use" after all retries.

@matthiasL-scality matthiasL-scality requested a review from a team as a code owner April 10, 2026 12:54
Copy link
Copy Markdown

@cmeron cmeron left a comment

Choose a reason for hiding this comment

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

Please take a look at my comments but overall LGTM!

Comment thread runner_manager/backend/scaleway.py Outdated
Comment thread runner_manager/backend/scaleway.py Outdated
@matthiasL-scality matthiasL-scality force-pushed the PTFE-3162-fix-volume-delete branch from aba05f5 to d95c753 Compare April 13, 2026 07:48
@matthiasL-scality
Copy link
Copy Markdown
Contributor Author

@claude[agent] review

@Claude
Copy link
Copy Markdown

Claude AI commented Apr 13, 2026

@claude[agent] review

Review completed. The implementation looks good:

✅ Properly uses block_error.status_code for HTTP status code checking
✅ Retry logic with exponential backoff (1s, 2s, 4s, 8s) handles temporary "in_use" states
✅ Correctly distinguishes between 404 (not found), 412 (in_use), and other errors
✅ Comprehensive test coverage for both success and failure scenarios
✅ Graceful fallback from Block API to Instance API for different volume types

The code correctly addresses the volume deletion reliability issue for Scaleway block storage.

@matthiasL-scality matthiasL-scality marked this pull request as draft April 13, 2026 08:01
@matthiasL-scality matthiasL-scality marked this pull request as ready for review April 13, 2026 08:01
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.79%. Comparing base (a938a6c) to head (f9abec7).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

❌ Your patch status has failed because the patch coverage (4.54%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #712      +/-   ##
==========================================
+ Coverage   85.71%   85.79%   +0.07%     
==========================================
  Files          36       36              
  Lines        1799     1809      +10     
==========================================
+ Hits         1542     1552      +10     
  Misses        257      257              
Flag Coverage Δ
api 56.77% <4.54%> (-0.26%) ⬇️
unit 70.53% <100.00%> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@matthiasL-scality matthiasL-scality force-pushed the PTFE-3162-fix-volume-delete branch from edce7dd to d95c753 Compare April 13, 2026 08:16
@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 13, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@matthiasL-scality matthiasL-scality force-pushed the PTFE-3162-fix-volume-delete branch from d95c753 to f9abec7 Compare April 13, 2026 08:22
@matthiasL-scality matthiasL-scality merged commit b635b01 into main Apr 13, 2026
19 of 20 checks passed
@matthiasL-scality matthiasL-scality deleted the PTFE-3162-fix-volume-delete branch April 13, 2026 08:42
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