You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you run a sync job and if you try to click Sync storage button again while the sync job is already running, clicking Sync storage caused a 500 with ValueError: signal only works in main thread of the main interpreter. This happened because is_job_on_worker() used StartedJobRegistry.get_job_ids(), which internally runs registry cleanup using RQ’s “death penalty” (SIGALRM). When called from a Django request thread (not the main interpreter thread), that signal setup fails and bubbles up as a runtime error.
The fix changes is_job_on_worker() to perform a read-only membership check directly in Redis using ZSCORE on the registry’s sorted set key, instead of calling get_job_ids(). Behavior is unchanged from the caller’s perspective (we still answer “is this job id currently started?”), but we no longer trigger any signal-based timeout logic in request threads, so storage sync works reliably without runtime errors.
❌ Patch coverage is 80.85106% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.91%. Comparing base (620b10c) to head (bf4f4be). ⚠️ Report is 7 commits behind head on develop.
✅ All tests successful. No failed tests found.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you run a sync job and if you try to click Sync storage button again while the sync job is already running, clicking Sync storage caused a 500 with
ValueError: signal only works in main thread of the main interpreter. This happened because is_job_on_worker() used StartedJobRegistry.get_job_ids(), which internally runs registry cleanup using RQ’s “death penalty” (SIGALRM). When called from a Django request thread (not the main interpreter thread), that signal setup fails and bubbles up as a runtime error.The fix changes is_job_on_worker() to perform a read-only membership check directly in Redis using ZSCORE on the registry’s sorted set key, instead of calling get_job_ids(). Behavior is unchanged from the caller’s perspective (we still answer “is this job id currently started?”), but we no longer trigger any signal-based timeout logic in request threads, so storage sync works reliably without runtime errors.