Skip to content

fix: allow Actor.reboot() to be retried after a failed or cancelled attempt#968

Draft
vdusek wants to merge 1 commit into
masterfrom
fix/reboot-retry-after-failed-attempt
Draft

fix: allow Actor.reboot() to be retried after a failed or cancelled attempt#968
vdusek wants to merge 1 commit into
masterfrom
fix/reboot-retry-after-failed-attempt

Conversation

@vdusek

@vdusek vdusek commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

  • Actor.reboot() set the internal _is_rebooting flag before doing any work and never reset it on failure. When the reboot API call raised (or the precondition check failed), the flag stayed True and every subsequent reboot() call was silently skipped for the rest of the run, making retries impossible.
  • The run-id precondition check now runs before the flag is set, and the whole reboot sequence is wrapped so that any failure or cancellation resets the flag before re-raising. After a successful reboot the flag intentionally stays set, so duplicate reboot calls remain suppressed while the platform stops the container.
  • custom_after_sleep=timedelta(0) is now honored instead of being replaced by the default.
  • Adds regression tests covering retry after a failed attempt and after a cancelled attempt.

🤖 Generated with Claude Code

…ttempt

A failed reboot API call left the internal rebooting flag set, so every
subsequent reboot() call was silently skipped for the rest of the run.
@vdusek vdusek added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Jun 11, 2026
@vdusek vdusek self-assigned this Jun 11, 2026
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.89%. Comparing base (2cc5602) to head (d69d0ac).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/apify/_actor.py 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #968      +/-   ##
==========================================
- Coverage   89.91%   89.89%   -0.02%     
==========================================
  Files          49       49              
  Lines        3085     3089       +4     
==========================================
+ Hits         2774     2777       +3     
- Misses        311      312       +1     
Flag Coverage Δ
e2e 35.93% <0.00%> (-0.05%) ⬇️
integration 56.87% <0.00%> (-0.11%) ⬇️
unit 78.73% <95.83%> (+0.02%) ⬆️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants