UN-3560 [FEAT] PG Queue 9 — run-worker.sh -L celery log alias#2066
UN-3560 [FEAT] PG Queue 9 — run-worker.sh -L celery log alias#2066muhammad-ali-e merged 2 commits intofeat/UN-3445-pg-queue-integrationZipstack/unstract:feat/UN-3445-pg-queue-integrationfrom UN-3560-celery-log-aliasZipstack/unstract:UN-3560-celery-log-aliasCopy head branch name to clipboard
-L celery log alias#2066Conversation
`./run-worker.sh -L pg-queue` already tails the PG-queue set's logs, but there was no symmetric way to tail only the Celery set: `-L` (no arg) tails EVERYTHING (Celery + PG-queue consumer/reaper), since list_core_worker_dirs includes the PG worker dirs. Add a `-L celery` log alias (mirror of `-L pg-queue`): tails every worker log EXCEPT the PG-queue members (pg_queue_consumer, pg_queue_reaper). Logs-only — the Celery set is still run via 'all'. run-worker.sh only: CELERY_SET constant + a branch in tail_logs() + usage/examples. Dev-tested with stub PG logs: -L = 11 files, -L celery = 9 (PG excluded), -L pg-queue = 2 (PG only). bash -n clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
muhammad-ali-e
left a comment
There was a problem hiding this comment.
Automated PR Review — -L celery log alias
Ran the PR Review Toolkit (Code Reviewer, Silent-Failure Hunter, Type-Design Analyzer, Test Analyzer, Comment Analyzer, Code Simplifier) against the diff vs feat/UN-3445-pg-queue-integration.
Verdict: no blocking issues. Quoting, set -e handling, word-splitting, and the local f / f=$(...) split all follow this file's established conventions, and the empty-result case correctly falls through to the shared guard rather than exec tail with no args.
The inline comments below are quality/consistency improvements, ordered by value:
P1 — worth fixing here
- Comment accuracy: the "Mirror" wording (constant block + inline) misdescribes the control flow —
celeryandpg-queueare complementary sets in different branches, not mirror implementations. - Duplication: the new
celerybranch is a near-verbatim copy of theallbranch; they can collapse into one loop with an exclusion guard.
P2 — hardening / consistency
3. Modeling: the {consumer, reaper} membership test is now the 4th hand-rolled copy in this file — a single PG_QUEUE_MEMBERS source of truth would keep the celery = all − pg-queue invariant true by construction.
4. UX (inherited from siblings): -L celery with no logs exits 0 with a generic message that misattributes the cause for this set.
Tests: none added; none strictly required given this is logs-only tooling with no existing shell-test harness. If a regression guard is wanted cheaply, gate the final exec tail -F on a dry-run env var and add a ~30-line bash test asserting the celery set excludes both PG members and the empty set exits cleanly.
…G members + dedup Address PR #2066 toolkit review: - Comment accuracy (P1, x2): reword 'mirrors PG_QUEUE_SET' / 'mirror of the pg-queue alias' — the celery set is the COMPLEMENT (all minus the two PG members), in a different branch, not a mirror. Drop the directional 'below'. - Modeling (P2): add a single 'PG_QUEUE_MEMBERS' source of truth (readonly assoc array) so 'celery = all - pg-queue' stays correct by construction; the celery branch tests membership via it instead of hand-rolling consumer/reaper. - Simplification (P1): collapse the near-duplicate 'all' and 'celery' tail_logs branches into one loop with a membership-guarded skip. Deferred (P2, inherited): set-aware empty-result message for the shared zero-log guard — spans all three set aliases, best done as one follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Review addressed — commit
|
473603a
into
feat/UN-3445-pg-queue-integration
What & why
./run-worker.sh -L pg-queuealready tails the PG-queue set's logs, but there was no symmetric way to tail only the Celery set.-L(no arg) tails everything — Celery and the PG-queue consumer/reaper — becauselist_core_worker_dirsincludes the PG worker dirs. With both transports running side by side (the strangler-fig setup), the Celery logs get buried in PG-queue chatter.This adds a
-L celerylog alias — the mirror of-L pg-queue— that tails every worker log except the PG-queue members (pg_queue_consumer,pg_queue_reaper).Logs-only: the Celery set is still run via
all(PG-queue is opt-in, never inall), so no run-path change is needed.Change
workers/run-worker.shonly:CELERY_SET="celery"constant (mirrorsPG_QUEUE_SET)tail_logs()that iterates core + pluggable dirs, skipping the two PG typesDev-test
With stub PG log files present:
-L→ 11 files (9 Celery + 2 PG)-L celery→ 9 files (PG excluded) ✅-L pg-queue→ 2 files (PG only) ✅bash -n run-worker.shclean.Notes
feat/UN-3445-pg-queue-integration(notmain).🤖 Generated with Claude Code