Skip to content

chore(collector): expose cancellation stalls - #19

Merged
proerror77 merged 1 commit into
mainfrom
codex/collector-cancellation-diagnostics
Jul 14, 2026
Merged

chore(collector): expose cancellation stalls#19
proerror77 merged 1 commit into
mainfrom
codex/collector-cancellation-diagnostics

Conversation

@proerror77

@proerror77 proerror77 commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • name receiver, snapshot and resync tasks
  • log cancel acceptance, cancellation count and top stack location for each stalled task
  • log queue size at session teardown

Scope

Observability only: collection, cancellation timeout and fatal behavior are unchanged.

Evidence

  • python3 -m unittest deployment/aliyun/test_binance_lob_archiver.py (29 passed)
  • python3 -m py_compile deployment/aliyun/binance_lob_archiver.py deployment/aliyun/test_binance_lob_archiver.py
  • git diff --check
  • Standards review: 0 findings
  • Spec review finding addressed: diagnostic test now locks the coro field

Summary by CodeRabbit

  • Bug Fixes

    • Improved websocket shutdown and resynchronization handling.
    • Added clearer operational logs for task cancellation timeouts, task details, and queue status.
    • Added descriptive names to background tasks to make troubleshooting easier.
  • Tests

    • Strengthened validation of cancellation timeout logs, including task context and cancellation details.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b0f8928f-7a9d-48d7-9f73-c2744cbe2bb6

📥 Commits

Reviewing files that changed from the base of the PR and between 35b73b7 and 7d3e03b.

📒 Files selected for processing (2)
  • deployment/aliyun/binance_lob_archiver.py
  • deployment/aliyun/test_binance_lob_archiver.py

📝 Walkthrough

Walkthrough

The archiver now names websocket-related tasks, logs queue state during teardown, and records detailed diagnostics when cancellation leaves tasks pending. The cancellation test creates a named stubborn task and verifies the emitted diagnostic fields.

Changes

Task cancellation observability

Layer / File(s) Summary
Bounded cancellation diagnostics
deployment/aliyun/binance_lob_archiver.py, deployment/aliyun/test_binance_lob_archiver.py
cancel_tasks_bounded logs per-task cancellation state and coroutine locations after timeout, while the test verifies the detailed error output.
Session task identity and queue logging
deployment/aliyun/binance_lob_archiver.py
Receiver, snapshotter, and resync tasks receive explicit names, and teardown logs queue size and maximum capacity before cancellation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • proerror77/monday#6: Updates the same archiver’s bounded task cancellation behavior and related test assertions.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main change: exposing cancellation stalls through added observability and task naming.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/collector-cancellation-diagnostics

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.

@proerror77
proerror77 merged commit ecfdb48 into main Jul 14, 2026
18 checks passed
@proerror77
proerror77 deleted the codex/collector-cancellation-diagnostics branch July 15, 2026 20:23
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