Skip to content

fix: taskiq worker healthcheck and cross-replica socket events#879

Merged
PythonFZ merged 1 commit intomainfrom
fix/docker-health
Mar 19, 2026
Merged

fix: taskiq worker healthcheck and cross-replica socket events#879
PythonFZ merged 1 commit intomainfrom
fix/docker-health

Conversation

@PythonFZ
Copy link
Copy Markdown
Member

@PythonFZ PythonFZ commented Mar 19, 2026

Summary

  • TaskIQ healthcheck: The worker container inherited the Dockerfile's HTTP healthcheck (pings :8000) but has no web server — always reported "unhealthy". Overridden with pgrep -f 'taskiq worker' in both standalone and production compose files.
  • Cross-replica socket events: Bumped zndraw-socketio>=0.1.6 which fixes AsyncRedisManager being stored on the wrapper instead of the underlying socketio.AsyncServer. This caused socket events to only reach clients on the same replica, breaking real-time updates from taskiq workers in multi-replica deployments.

Test plan

  • Deploy with updated compose — verify docker compose ps shows taskiq-worker as "healthy"
  • Run an extension from the browser — verify frame count updates and task status changes in real-time without page refresh
  • Confirm two browsers on different replicas (different IPs) receive each other's socket events

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Enhanced task worker reliability with automated health monitoring to detect service status.
    • Updated backend dependencies to include the latest improvements and fixes.

The taskiq-worker container inherited the Dockerfile HEALTHCHECK which
pings :8000 — but the worker has no HTTP server, so it was permanently
"unhealthy". Override with a pgrep-based process check in both compose
files.

Bump zndraw-socketio>=0.1.6 which fixes AsyncRedisManager not being
set on the underlying socketio.AsyncServer (was stored on the wrapper
only), causing socket events to never cross replicas via Redis pub/sub.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9c869d3-1061-454a-9184-9066a315450b

📥 Commits

Reviewing files that changed from the base of the PR and between fe40887 and cc18de6.

📒 Files selected for processing (3)
  • docker/production/docker-compose.yaml
  • docker/standalone/docker-compose.yaml
  • pyproject.toml

📝 Walkthrough

Walkthrough

Docker Compose configurations for both production and standalone environments now include health monitoring for the taskiq-worker service. Additionally, the minimum required version constraint for the zndraw-socketio dependency was incremented.

Changes

Cohort / File(s) Summary
Docker Compose Healthchecks
docker/production/docker-compose.yaml, docker/standalone/docker-compose.yaml
Added healthcheck to taskiq-worker service that monitors process presence via pgrep with 30s interval, 5s timeout, and 3 retries.
Dependency Version Constraint
pyproject.toml
Updated zndraw-socketio minimum version from >=0.1.5 to >=0.1.6.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A worker needs watching, a heartbeat to keep,
With healthchecks and versions, no crashes in sleep,
Docker now listens every thirty seconds true,
While dependencies climb to what's fresh and new! 💚

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the two main changes: taskiq worker healthcheck configuration and cross-replica socket events via zndraw-socketio dependency bump.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/docker-health
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 19, 2026

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #879      +/-   ##
==========================================
+ Coverage   91.12%   91.23%   +0.10%     
==========================================
  Files         179      179              
  Lines       17270    17270              
==========================================
+ Hits        15738    15756      +18     
+ Misses       1532     1514      -18     

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

@PythonFZ PythonFZ merged commit a18d17e into main Mar 19, 2026
6 checks passed
@PythonFZ PythonFZ deleted the fix/docker-health branch March 19, 2026 16:46
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.

2 participants