Skip to content

Conversation

@makseq
Copy link
Member

@makseq makseq commented Nov 20, 2025

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.

image

@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for heartex-docs ready!

Name Link
🔨 Latest commit bf4f4be
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/691fb6d013e31c0008cec0d0
😎 Deploy Preview https://deploy-preview-8851--heartex-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the fix label Nov 20, 2025
@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for label-studio-storybook canceled.

Name Link
🔨 Latest commit bf4f4be
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/691fb6d0a100190008453678

@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for label-studio-docs-new-theme ready!

Name Link
🔨 Latest commit bf4f4be
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/691fb6d05136bf00084ace6c
😎 Deploy Preview https://deploy-preview-8851--label-studio-docs-new-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for label-studio-playground canceled.

Name Link
🔨 Latest commit bf4f4be
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/691fb6d0a5cbb60008a493cc

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ 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.

Files with missing lines Patch % Lines
label_studio/core/tests/test_redis.py 85.71% 6 Missing ⚠️
label_studio/io_storages/base_models.py 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #8851       +/-   ##
============================================
+ Coverage    66.70%   80.91%   +14.21%     
============================================
  Files          813      259      -554     
  Lines        63619    23438    -40181     
  Branches     10765        0    -10765     
============================================
- Hits         42437    18965    -23472     
+ Misses       21178     4473    -16705     
+ Partials         4        0        -4     
Flag Coverage Δ
lsf-e2e ?
lsf-integration ?
lsf-unit ?
pytests 80.91% <80.85%> (+0.01%) ⬆️

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.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@makseq makseq closed this Nov 21, 2025
@makseq makseq deleted the fix-storage-sync branch November 21, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants