Skip to content

fix(health): reset stuck pending jobs on startup and add disable toggle - #335

Merged
javi11 merged 1 commit into
mainfrom
fix/health-pending-stuck-and-disable
Feb 25, 2026
Merged

fix(health): reset stuck pending jobs on startup and add disable toggle#335
javi11 merged 1 commit into
mainfrom
fix/health-pending-stuck-and-disable

Conversation

@javi11

@javi11 javi11 commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix stuck pending jobs: Files stuck in pending with retry_count >= max_retries were silently excluded from the GetUnhealthyFiles() query and never re-checked. A new ResetStalePendingFiles() call during worker startup resets their retry count so they get picked up in the next cycle.
  • Add disable toggle: Health checking can now be disabled by setting health.enabled: false in config. The Health.Enabled field already existed in the config struct but was never checked — GetHealthEnabled() is now checked at the start of Start().

Test plan

  • Add files to health check with retry_count = max_retries → restart worker → verify files are rechecked in the next cycle
  • Set health.enabled: false in config → restart → verify worker does not start (log: "Health worker is disabled via configuration")
  • Set health.enabled: true or omit → verify worker starts normally

🤖 Generated with Claude Code

- Add ResetStalePendingFiles() to reset pending files where retry_count
  >= max_retries back to retry_count=0; these were silently excluded from
  health cycles forever
- Call ResetStalePendingFiles() during worker Start() alongside the existing
  ResetFileAllChecking() call
- Add GetHealthEnabled() config accessor (Health.Enabled field already
  exists in HealthConfig struct)
- Check GetHealthEnabled() at the start of Start() - if disabled, log a
  warning and return nil without starting the worker

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javi11
javi11 merged commit 71e569c into main Feb 25, 2026
1 of 2 checks passed
@javi11
javi11 deleted the fix/health-pending-stuck-and-disable branch February 26, 2026 14:08
yoshitaka420 pushed a commit to yoshitaka420/altmount that referenced this pull request Jun 1, 2026
…le (kipsilabs#335)

- Add ResetStalePendingFiles() to reset pending files where retry_count
  >= max_retries back to retry_count=0; these were silently excluded from
  health cycles forever
- Call ResetStalePendingFiles() during worker Start() alongside the existing
  ResetFileAllChecking() call
- Add GetHealthEnabled() config accessor (Health.Enabled field already
  exists in HealthConfig struct)
- Check GetHealthEnabled() at the start of Start() - if disabled, log a
  warning and return nil without starting the worker

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant