← Back to Pull requests

[Bugfix] Give SHM connector lock files a segment-derived lifecycle (#7636 Issue 24) #7840

Open
yanbao1217 opened this pull request with 1068 lines diff across 10 files
View on GitHub
yanbao1217 yanbao1217 commented on Sep 19, 2026 16:58 UTC
Author

Contributor intent

1. What outcome do you want to achieve?

Reclaim per-key lock files left by interrupted SHM transfers and keep the next transfer using the same key readable. Tracking issue, item 24

2. What is the highest-leverage variable for that outcome?

When the connector unlinks a lock file. A missing segment can mean that the transfer was abandoned or that a writer holds the lock and is still preparing the segment. Original self-review

3. How will this work move that variable?

Take the exclusive lock, verify that the path still names the locked file, and check whether the segment exists before removing an orphan lock. On Linux, record the published segment's device and inode so a deferred release can recognize a same-key replacement.

4. Whose customer or user needs does this address, and what are those needs?

Users of same-host, multi-stage pipelines need interrupted and partially consumed transfers to release their files while active transfers stay readable.

Purpose

A publisher can exit and leave a regular lock file after Python removes the shared-memory segment. The connector verifies the locked file and the absence of the segment before reclaiming an orphan. Key-only reads give new locks a 60-second grace period. Deadline-bound reads skip the directory scan and recheck their deadline under the lock.

V1 terminal cleanup runs on the send thread. MRv2 releases chunks under the lock that protects request registration and output state. Both paths try the publication lock without waiting. If it is busy, the sender can retry an identified publication during later puts or in its idle send loop. Shutdown tries each tracked publication once, skips busy segments, and closes local resources.

Two cases could still lose data or leave an unread segment behind:

  • When the publishing backend returned no stable identity, or its identity lookup failed, the old sender could later unlink a peer's completed same-key replacement. The sender now registers a publication for automatic cleanup only when it records a stable identity under the publication lock. Otherwise it discards any older record for that key. The receiver can consume the segment, and explicit cleanup(key) remains available.

  • A temporary error during a scheduled retry used to cancel future attempts. The sender now keeps the retry scheduled across lock-open, identity-check and unlink failures. On a later pass it rechecks the original identity before deleting anything.
  • Independently launched Python processes can have separate resource trackers. On process exit, a tracker can unlink a replacement by name without taking the connector lock. This can leave its lock file behind. SHM cleanup and shutdown contract

    Test Plan

    vLLM Version: 0.34.0 with PyTorch 2.14.0 and Python 3.12.3 on Linux x86_64
    vLLM-Omni Commit: e2ae09ffd2a7d6dbbb73e12e8d09966e5a010459

    Run the seven new regression cases on 2c8184f and the fix with identical test files and native Linux shared memory. Run the affected CPU suite on the signed commit:

    python -m pytest -q -m 'core_model and cpu' \
      tests/distributed/omni_connectors \
      tests/worker/test_omni_connector_mixin.py \
      tests/worker_v2/test_omni_data_plane.py
    

    Test Result

  • On 2c8184f, all seven new cases failed. Four lost a replacement after tracked cleanup or close. Three stopped retrying after a temporary failure opening the lock, checking segment identity or unlinking the segment.

  • On e2ae09f, the same seven cases passed. The broader CPU run passed 876 tests in 149.48 seconds. One test skipped because it found no configuration files. The CPU selection deselected 38 tests.

  • In a separate two-process run, the replacement was present after the old connector closed. When the old process exited, its resource tracker removed the segment and left the lock file. The CUDA end-to-end SHM leak test was not run in this Linux verification.
  • Diff: 1068 lines (+930 / -138) across 10 files Reviewer: hsliuustc0106 Review duration: 112044m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.68) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.68 · 1068 lines diff across 10 files
    0.68
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.95 · 5 substantive comment(s)
    0.95
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    90%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    43 items
    vllm-omni-review-bot vllm-omni-review-bot commented on Sep 19, 2026 17:00 UTC
    Bot

    This PR appears to belong to: docs/design/module/omni_connector.md, docs/design/module/input_output_modality_contracts.md, docs/design/module/diffusion/parallelism.md.

    Module owners: @princepride @fake0fan @natureofnature

    Routing: @princepride via module of the changed files, module named in the PR description, CODEOWNERS; @fake0fan via module of the changed files, module named in the PR description; @natureofnature via module of the changed files, module named in the PR description

    @yanbao1217, please review your own changes and leave a short self-review comment describing what you checked. PRs without author self-review may not be assigned a reviewer.

    Please take a look when you have a chance. If you would like an automated review, mention @vllm-omni-review-bot in a comment.

    <!-- omni-reviewbot:assignment:v1 repo=vllm-project/vllm-omni pr=7840 -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Sep 19, 2026 17:03 UTC
    Bot

    Omni ReviewBot triage note

    Automated triage of commit e2ae09ffd2a7 produced:

  • Priority: high. Prompt maintainer attention is suggested.
  • These are automated triage suggestions only — the final decision belongs to the maintainers.

    <!-- omni-reviewbot:quality-note:v1 repo=vllm-project/vllm-omni pr=7840 -->
    <!-- omni-reviewbot:quality-note-head:e2ae09ffd2a7d6dbbb73e12e8d09966e5a010459 -->
    <!-- omni-reviewbot:quality-note-state:live -->

    yanbao1217 yanbao1217 commented on Sep 20, 2026 01:37 UTC
    Author

    Self-review:

  • Re-read the final diff against the lifecycle contract documented on SharedMemoryConnector. The new removal paths for failed put(), failed reads after segment loss, and startup sweeping preserve the rule that an orphan lock is reclaimable only after its backing segment is gone; existing cleanup(), close(), and _pending_keys behavior is unchanged.

  • Re-checked the sweep against its main false-positive cases: fresh locks in the creator open() -> flock() window, actively held locks, live segments, unrelated filenames, and foreign-uid files are all skipped. Per-file syscall failures are contained and do not abort the sweep.

  • Tests pass: 29/29 in test_shm_connector.py, and 379 passed / 1 environment-dependent skip in tests/distributed/omni_connectors under core_model and cpu. /dev/shm has no lockfile residue after the suite.

  • Verified the cross-process failure modes with a standalone harness against both unpatched main and this branch: failed put(), deserialize failure after read, sender SIGKILL, clean exit without close(), and partial multi-chunk consumption. The leaks reproduce on main and are cleaned on this branch.

  • ruff, mypy==1.11.1, and forbidden-import checks pass. I found no additional correctness issue beyond the residual races already documented in the PR description.
  • NickCao NickCao commented on Sep 23, 2026 13:00 UTC
    Contributor

    Out of scope for this PR: we are implementing file lock manually using fcntl in multiple places, these should be replaced with the filelock library.

    yanbao1217 yanbao1217 commented on Sep 24, 2026 01:45 UTC
    Author

    Thanks for taking a look! Happy to track the migration in a separate issue if that helps.

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 01, 2026 01:51 UTC
    Bot

    Omni ReviewBot: no human activity for 7 days

    @yanbao1217 this pull request has had no human commit, comment or review since 2026-09-24. Please confirm the current plan and next step. The author or a maintainer decides whether to change the PR state.

    To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline.

    <!-- omni-reviewbot:stale:v1 repo=vllm-project/vllm-omni pr=7840 window=2026-09-24T01:45:00+00:00 -->
    <!-- omni-reviewbot:quality-note-state:live -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 06, 2026 20:02 UTC
    Bot

    <details>
    <summary>Omni ReviewBot routing record</summary>

    Assigned Strict on cursor (cursor-grok-4.6-high) under experiment fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002.
    </details>

    <!-- omni-reviewbot:mode-assignment:v1
    {
    "algorithm": "hmac-sha256-bucket-v1",
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "backend": "cursor",
    "bucket": 513,
    "bucket_proof": "01a1f53dc3b17461264333afd7d682077ecee7937c6271b6fd2728075ccebd44",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "head_sha_at_assignment": "fc17ff94fb4b275a69af9739cbe28f1882e16990",
    "infermatrix_sha_at_assignment": "infermatrix-copilot==0.2.0",
    "model": "cursor-grok-4.6-high",
    "policy_sha256": "a923e3808fb913b7f34ce67fdf17fb4c5bf810abb19c7dcac2599eb356d1bd6d",
    "pr": 7840,
    "repo": "vllm-project/vllm-omni",
    "repo_id": 1054512829,
    "reviewbot_sha": "unknown",
    "salt_id": "s3-c5-z10-20261002",
    "source": "split",
    "trigger_comment_id": null,
    "unit": "pull_request"
    }
    -->

    yanbao1217 yanbao1217 commented on Oct 09, 2026 02:08 UTC
    Author

    Hi @chickeyton @princepride @NickCao @hsliuustc0106 , following up on this PR for Issue 24 in #7636. I noticed the tracking issue has been closed, while Issue 24 is still listed as “reviewing” and this PR remains open.

    Should this SHM lock-file lifecycle fix still proceed independently, or has it been superseded by other cleanup work? If it is still wanted, could you help review it or point me to the appropriate reviewer? I’m happy to resolve the current merge conflicts and rerun the tests. Thanks!

    vllm-omni-review-bot vllm-omni-review-bot commented on code on Oct 10, 2026 04:52 UTC
    Code Review
    vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:1
    @@ -33,6 +119,10 @@ def __init__(self, config: dict[str, Any]):
                 "gets": 0,
                 "bytes_transferred": 0,
             }
    +        global _swept_this_process
    +        if not _swept_this_process:
    +            _swept_this_process = True  # set first: the sweep is idempotent anyway
    +            _sweep_stale_lock_files()

    [P0] This PR cannot merge onto current vllm-project:main: GitHub reports mergeable=f…

    <details>
    <summary>Evidence and suggested fix</summary>

    This PR cannot merge onto current vllm-project:main: GitHub reports mergeable=false / mergeable_state=dirty / rebaseable=false (base 51c715c7, head fc17ff94). This tree's SharedMemoryConnector.__init__ calls once-per-process _sweep_stale_lock_files() (shm_connector.py:123-125) and _get_data_with_lock unlinks via deserialized or seg_gone (shm_connector.py:185-186). Live main already replaced this file with wakeup FIFOs (/dev/shm/omni_shm_wake_*), get_with_deadline, _wake_receiver, reap_consumed, cleanup_prefix, LOCK_NB, and OrderedDict _pending_keys; this PR-time tree has zero matches for those symbols. After rebase, port only the still-missing pieces: failed put() lock unlink (main's put() still does meta = shm_write_bytes(...) with no lock-file except) plus dead-segment lock removal and the startup sweep. Do not overlay deserialized or seg_gone on main's get path: it already sets consumed = True immediately after shm_read_bytes and unlinks the lock in finally if consumed. Re-run tests/distributed/omni_connectors/test_shm_connector.py after the port.

    Evidence: Trigger: merge/rebase of this head onto current vllm-project:main. Adverse effect: GitHub will not merge, and overlaying this get() lock policy would replace main's already-correct consume-after-read unlink (and drop LOCK_NB/wakeup). PR-time tree shm_connector.py:125 _sweep_stale_lock_files(); shm_connector.py:185-186 seg_gone = not os.path.exists(f"/dev/shm/{shm_handle['name']}") / if deserialized or seg_gone:. Unchanged by this diff, live GitHub GET /repos/vllm-project/vllm-omni/pulls/7840: "mergeable": false, "rebaseable": false, "mergeable_state": "dirty", base sha 51c715c7ef87c23bde02cb274a3741f3d8301857. Unchanged by this diff and absent from the PR-time tree (grep: 0 matches for reap_consumed / get_with_deadline / _wake_receiver / cleanup_prefix): live vllm-project/main shm_connector.py put() still does meta = shm_write_bytes(payload, name=put_key) with no lock-file except; _get_data_with_lock does data_bytes = shm_read_bytes(shm_handle) then consumed = True then finally: if consumed: os.remove(lock_file).

    </details>

    vllm-omni-review-bot vllm-omni-review-bot commented on code on Oct 10, 2026 04:52 UTC
    Code Review
    vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:1
    @@ -79,10 +178,15 @@ def _get_data_with_lock(self, lock_file: str, shm_handle: dict[str, Any]) -> tup
                 logger.error(f"SharedMemoryConnector shm get failed for req : {e}")
                 return None
             finally:
    -            if deserialized:
    +            # The lock file has no lifecycle of its own: once the segment is
    +            # gone (consumed by this read, or already reaped elsewhere) the
    +            # lock guarding it must go too.  A failed read with the segment
    +            # still alive keeps the lock — the transfer can be retried.
    +            seg_gone = not os.path.exists(f"/dev/shm/{shm_handle['name']}")

    [P1] Production SHM polling never enters _get_data_with_lock's new reclaim

    <details>
    <summary>Evidence and suggested fix</summary>

    Production SHM polling never enters _get_data_with_lock's new reclaim. chunk_transfer_adapter.py:57-65 sets source_metadata to {source_host, source_port} or None, so get() at shm_connector.py:233-243 takes _get_by_key. After a crashed sender's segment is gone, SharedMemory(name=get_key) raises FileNotFoundError and shm_connector.py:205-206 returns None without touching /dev/shm/shm_{key}_lockfile.lock. The receiver already set _swept_this_process True in __init__, so constructor sweep will not run again and crash leftovers this PR claims to fix keep accumulating on tmpfs. test_get_failure_dead_segment_removes_lock_file hides this by passing metadata=meta from put() ({"shm": ...} at shm_connector.py:154), which takes the metadata path. Reclaim that lock on the FileNotFoundError with the same check–LOCK_NB–recheck protocol (keep the 60s grace so put()'s open→flock window is not stolen), and add a regression get(..., metadata=None) after unlinking the segment.

    Evidence: Trigger: a live receiver polls connector.get(..., entry.source_metadata) after the sender's POSIX segment has been reaped; source_metadata has no shm key, so get() never calls _get_data_with_lock. Adverse effect: /dev/shm/shm_{key}_lockfile.lock is left on tmpfs forever on that process because _get_by_key swallows FileNotFoundError and _swept_this_process is already True. shm_connector.py:205-206 except FileNotFoundError: / return None. shm_connector.py:239-243 result = self._get_by_key(get_key) / else: / result = self._get_by_key(get_key). shm_connector.py:122-125 _swept_this_process = True then _sweep_stale_lock_files(). Unchanged by this diff, present in the PR-time tree: chunk_transfer_adapter.py:57-65 self.source_metadata = None then, if host and zmq_port exist, {"source_host": str(host), "source_port": int(port)} (no shm key); chunk_transfer_adapter.py:504-508 result = self.connector.get(..., entry.source_metadata). Test that hides the path: test_shm_connector.py:322 result = connector.get("s0", "s1", key, metadata=meta) with put() metadata shm_connector.py:154 metadata = {"shm": meta, "size": size}.

    Suggestion: except FileNotFoundError:
    lock_file = f"/dev/shm/shm_{get_key}_lockfile.lock"
    try:
    _sweep_stale_lock_files() # single-key reclaim is better; reuse grace/LOCK_NB so in-flight put() is not stolen
    except OSError:
    pass
    return None

    </details>

    vllm-omni-review-bot vllm-omni-review-bot commented on code on Oct 10, 2026 04:52 UTC
    Code Review
    vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:1
    @@ -33,6 +119,10 @@ def __init__(self, config: dict[str, Any]):
                 "gets": 0,
                 "bytes_transferred": 0,
             }
    +        global _swept_this_process
    +        if not _swept_this_process:
    +            _swept_this_process = True  # set first: the sweep is idempotent anyway

    [P1] This diff sets _swept_this_process = True before the first _sweep_stale_lock…

    <details>
    <summary>Evidence and suggested fix</summary>

    This diff sets _swept_this_process = True before the first _sweep_stale_lock_files() (shm_connector.py:123-125) and the sweep skips any lock whose mtime is younger than _STALE_LOCK_GRACE_SECONDS (60s; lines 19 and 56). The only production caller is SharedMemoryConnector.__init__; put()/get() never resweep. Default stage wiring is SharedMemoryConnector (unchanged omni_config.py:610), and workers construct it during init_omni_connectors / chunk-adapter init. After an abnormal exit, resource_tracker reaps the segment while the lock file remains; a new process that builds a connector within 60s (the normal restart window) grace-skips those orphans, then never visits them again for the life of that process — the crash-orphan leak this bugfix claims to close still accumulates. A grace that only covers the open()→flock() µs window must not be treated as a completed sweep: gate a resweep on a monotonic timestamp from __init__ and put()/get() (at most once per grace). test_crashed_subprocess_lock_swept_by_new_process cannot fail this contract: it _backdates the lock 120s, then calls _sweep_stale_lock_files in the same interpreter (test_shm_connector.py:472-473). Drive a young orphan through SharedMemoryConnector({}) without _backdate, then construct another connector after grace (or via the put-gated resweep) and assert the lock is gone.

    Evidence: Trigger: a new process constructs the default SharedMemoryConnector while crash-orphan lock files are still <60s old. shm_connector.py:19 _STALE_LOCK_GRACE_SECONDS = 60.0 # seconds; young lock files are never touched; shm_connector.py:56 if time.time() - os.stat(path).st_mtime < grace: then continue; shm_connector.py:123-125 if not _swept_this_process: / _swept_this_process = True # set first: the sweep is idempotent anyway / _sweep_stale_lock_files(). Adverse effect: those young orphans are skipped, the process-wide flag is already True so no later __init__/put/get revisits them, and /dev/shm/shm_*_lockfile.lock files accumulate for the worker lifetime — unmet by the class contract shm_connector.py:106-109 Abnormally terminated processes leave lock files behind once their / segments are reaped by `resource_tracker; the first connector / constructed in a new process sweeps such orphans / (_sweep_stale_lock_files).. Unchanged by this diff, present in the PR-time tree: omni_config.py:610 "name": "SharedMemoryConnector",; omni_connector_runtime.py:156-157 self._omni_connector: OmniConnectorBase | None = ( / self._create_connector(model_config) if _should_create_payload_connector(model_config) else None. The added test cannot fail this: test_shm_connector.py:472 self._backdate(lock) # the restart happens some time after the crash then line 473 shm_conn_module._sweep_stale_lock_files(grace=60.0).

    Suggestion: _maybe_sweep_stale_lock_files()

    </details>

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 10, 2026 04:52 UTC
    Reviewer

    Omni ReviewBot review

    4 actionable finding(s).

    CI at fc17ff94fb4b (2026-10-10T04:52:55.679006+00:00): required check(s) blocking: buildkite/vllm-omni (missing).

    <details>
    <summary>Full review analysis</summary>

    Scan:
    | Category | Result |
    |---|---|
    | Tests / verification | 3 finding(s) below |
    | Security | no finding reported |
    | Docs / comments | 1 finding(s) below |
    | Behavior / compatibility | no finding reported |
    | Correctness | no finding reported |

    Validated:

  • [resolved] author TOCTOU inode race: prefilter requires no segment (line 60) so live transfers are skipped; residual is same-key reincarnation vs path unlink; get() FileNotFoundError already logger.error at line 178 then None. Author accepted; adapter poll still retries.

  • [resolved] sweep false positives: fresh mtime, held flock, live segment, uid, unrelated names — tests 393-443. Residual: surviving peer never re-enters constructor sweep (_swept_this_process stays True).

  • [resolved] µs sweep/put inode race documented by author; get() returns None, sender close() reclaims. Not re-raised.

  • [resolved] fork inherit of _swept_this_process: stage_init_utils.py:773-777 forces spawn; residual is a parent that constructs then forks.

  • [claim-verified] main shm_connector.py is a different implementation (wakeup FIFOs, OrderedDict+_pending_keys_lock, reap_consumed, flock LOCK_NB, cleanup returns bool, close() calls cleanup). This PR still patches the pre-wakeup file.

  • [claim-verified] deserialize-after-read: shm_read_bytes unlinks then deserialize_obj raises; new finally removes lock. test_get_deserialize_failure_after_read_removes_lock_file drives the real get() entry.
  • 4 actionable finding(s).

    Verdict: REQUEST CHANGES

    </details>

    Findings

  • [P2] This PR changes the lock-file lifecycle in shm_connector.py (failed put unlinks… — docs/design/feature/omni_connectors/shared_memory_connector.md
  • <details>
    <summary>Evidence for This PR changes the lock-file lifecycle in shm_connector.py (failed put unlinks…</summary>

    This PR changes the lock-file lifecycle in shm_connector.py (failed put unlinks the lock; get unlinks only when deserialized or seg_gone; once-per-process _sweep_stale_lock_files) and documents that in the class docstring (shm_connector.py:100-110), but does not edit the indexed feature page. Unchanged shared_memory_connector.md:146 still lists get() step 5 as Remove the lock file if it still exists, and §5.1 put() still ends at write/return with no failure unlink. Update §4.3 / §5.1 / §5.2 to the new lifecycle so the published feature contract matches the implementation.

    Evidence: Trigger: this PR changes the SHM lock-file contract and the class docstring, but the feature design page is not in the diff. Unmet requirement: an active feature page whose put/get/locking contract changed must be updated in the same PR (design-contracts.md:30-31 When behavior changes an active module or feature contract, require the same PR to update that page.). Unchanged by this diff, present in the PR-time tree: docs/design/feature/omni_connectors/shared_memory_connector.md:146 5. Remove the lock file if it still exists. and :126-128 3. Acquire the per-request lock file. / 4. Write the bytes into shared memory. / 5. Return lightweight metadata to the caller. New contract in the diff: shm_connector.py:143-147 except BaseException: then os.remove(lock_file) and shm_connector.py:185-186 seg_gone = not os.path.exists(f"/dev/shm/{shm_handle['name']}") / if deserialized or seg_gone:. Adverse effect: readers of §5.1/§5.2 still see success-path-only lock handling (always remove after get; no failed-put unlink, keep-while-segment-lives, or orphan sweep), so the published feature contract no longer matches the implementation.

    Suggestion: 5. Remove the lock file when the segment is gone (successful read, failed read after unlink, or failed put); keep it while the segment still exists so the transfer can be retried. Orphans left after the owner dies are removed by a once-per-process startup sweep.

    </details>

    ---
    <sub>🤖 This review was generated by InferMatrix Copilot, an open-source repo-maintenance agent for PR review, CI debugging and issue triage. Try it on your own repo, and ⭐ star it if it helped!</sub>

    <!-- omni-reviewbot:v1 repo=vllm-project/vllm-omni pr=7840 head=fc17ff94fb4b275a69af9739cbe28f1882e16990 -->

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "6f604ff5ac018e890e28e4657efa86ac1396ee6259115de9a11d2202fd6475c1",
    "backend": "cursor",
    "duration_ms": 1994500,
    "executed_mode": "strict",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "cursor-grok-4.6-high",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": "fc17ff94fb4b275a69af9739cbe28f1882e16990",
    "terminal_state": "completed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 10, 2026 04:54 UTC
    Bot

    Omni ReviewBot: finding feedback

    [p1] Production SHM polling never enters _get_data_with_lock's new reclaim — vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:185

    See the review for details. If you are the PR author and disagree, react 👎 here; the maintainer will see your disagreement.

    <!-- omni-reviewbot:finding-feedback:v1 repo=vllm-project/vllm-omni pr=7840 finding=02b712729b48fe72 -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 10, 2026 04:54 UTC
    Bot

    Omni ReviewBot: finding feedback

    [p0] This PR cannot merge onto current vllm-project:main: GitHub reports mergeable=f… — vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:125

    See the review for details. If you are the PR author and disagree, react 👎 here; the maintainer will see your disagreement.

    <!-- omni-reviewbot:finding-feedback:v1 repo=vllm-project/vllm-omni pr=7840 finding=0c9bca2a479b4969 -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 10, 2026 04:58 UTC
    Bot

    Omni ReviewBot: finding feedback

    [p1] This diff sets _swept_this_process = True before the first _sweep_stale_lock… — vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:124`

    See the review for details. If you are the PR author and disagree, react 👎 here; the maintainer will see your disagreement.

    <!-- omni-reviewbot:finding-feedback:v1 repo=vllm-project/vllm-omni pr=7840 finding=f88c3511b7db3003 -->

    yanbao1217 yanbao1217 commented on Oct 10, 2026 14:33 UTC
    Author

    Thanks for the thorough review — all four findings are addressed in fb41bce23
    (reworked onto the wakeup-FIFO connector, mergeable again):

  • P0 (stale base): rebased onto the reworked connector; the get-path patch is

  • reduced to extending the existing consumed unlink with or seg_gone — main's
    consume-after-read semantics are untouched, as the finding suggested.
  • P1 (production polling never enters the reclaim): _get_by_key's

  • FileNotFoundError branch now calls _reclaim_orphan_lock_file(get_key) — the
    same check–LOCK_NB–recheck protocol with the grace window, so an in-flight
    put() is never stolen. Added the suggested regression (get(metadata=None)
    after the segment is gone) plus a young-lock guard test.
  • P1 (flag set before the first sweep): the once-per-process flag is gone;

  • _maybe_sweep_stale_lock_files() is gated on a monotonic timestamp checked from
    __init__/put()/get() (at most one sweep per grace period). Regression
    added: a young orphan is skipped by the first constructor and reclaimed by the
    next gated sweep once the grace really elapses (no clock faking — the grace is
    shrunk in the test).
  • P2 (feature page): shared_memory_connector.md §4.3/§5.1/§5.2/§5.3 updated

  • to the lifecycle contract.
  • buildkite/vllm-omni (missing) looks infra-side; nothing in this branch can

  • trigger it.

    Local: 60 passed on the changed file, 470 passed / 1 env skip on
    tests/distributed/omni_connectors, zero lockfile residue in /dev/shm.

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 10, 2026 17:00 UTC
    Bot

    <details>
    <summary>Omni ReviewBot attempt record</summary>

    Review attempt ended as failed (failed; retrying strict/cursor/cursor-grok-4.6-high in 120s (try 2 of 3)).
    </details>

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "234e3346500817054990b941ea3a125486e080076eb1d9da58cd7f956095783c",
    "backend": "cursor",
    "duration_ms": 242845,
    "executed_mode": "strict",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "cursor-grok-4.6-high",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": null,
    "terminal_state": "failed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 10, 2026 17:04 UTC
    Bot

    <details>
    <summary>Omni ReviewBot attempt record</summary>

    Review attempt ended as failed (failed; retrying strict/cursor/cursor-grok-4.6-high in 600s (try 3 of 3)).
    </details>

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "f73fb008e5518de4504b410126b4c632f2c477ee860555074fb9140605bd3d43",
    "backend": "cursor",
    "duration_ms": 93064,
    "executed_mode": "strict",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "cursor-grok-4.6-high",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": null,
    "terminal_state": "failed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 10, 2026 17:16 UTC
    Bot

    <details>
    <summary>Omni ReviewBot attempt record</summary>

    Review attempt ended as failed (failed; falling back to direct/cursor/auto).
    </details>

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "d131cba04280a5c2de40d3af55a7b7e3143fd48c6ca43ffb90d7c749680a07ef",
    "backend": "cursor",
    "duration_ms": 108185,
    "executed_mode": "strict",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "cursor-grok-4.6-high",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": null,
    "terminal_state": "failed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 10, 2026 17:47 UTC
    Reviewer

    Omni ReviewBot review

    Changes since the previous review

  • 1 new inline finding(s); 1 finding(s) below.

  • Fixed: Production SHM polling never enters _get_data_with_lock's new reclaim — vllm_omni/distributed/omni_connectors/connectors/shm_connector.py

  • Fixed: This PR cannot merge onto current vllm-project:main: GitHub reports mergeable=f… — vllm_omni/distributed/omni_connectors/connectors/shm_connector.py

  • Fixed: This PR changes the lock-file lifecycle in shm_connector.py (failed put unlinks… — docs/design/feature/omni_connectors/shared_memory_connector.md

  • Fixed: This diff sets _swept_this_process = True before the first _sweep_stale_lock… — vllm_omni/distributed/omni_connectors/connectors/shm_connector.py
  • CI at fb41bce236c7 (2026-10-10T17:39:05.419412+00:00): required check(s) blocking: buildkite/vllm-omni (missing).

    Note: The assigned review arm strict/cursor/cursor-grok-4.6-high could not complete this review, so it was produced by the fallback arm direct/cursor/auto. It is excluded from the routing experiment.

    <details>
    <summary>Full review analysis</summary>

    PR description

    SharedMemoryConnector treats each /dev/shm/shm_{key}_lockfile.lock file as tied to its POSIX segment. A failed put() removes the lock while the creator still holds flock; a read whose segment is already gone removes it; a key-based get() that hits FileNotFoundError reclaims that key's orphan after a 60s grace and a non-blocking lock. A process-wide sweep of stale lock files runs at most once per grace interval from __init__, put(), and get(), so a restart that lands inside the grace window can collect young crash leftovers on a later call. cleanup(), close(), and wakeup behavior are unchanged.

    Change flow

    flowchart TD
      Poll["[EXISTING] Stage put and key-based get"]:::existing
      Conn["[CHANGED] SharedMemoryConnector lock handling"]:::changed
      Reclaim["[NEW] Grace reclaim and time-gated sweep"]:::new
      Doc["[CHANGED] shared_memory_connector.md lifecycle"]:::changed
      Tests["[NEW] TestLockFileLifecycle"]:::new
      Poll --> Conn
      Conn --> Reclaim
      Reclaim --> Doc
      Conn --> Tests
      classDef existing fill:#e5e7eb,stroke:#6b7280,color:#111827
      classDef changed fill:#fef3c7,stroke:#d97706,color:#451a03,stroke-width:2px
      classDef new fill:#dcfce7,stroke:#16a34a,color:#052e16,stroke-width:2px
      classDef removed fill:#fee2e2,stroke:#dc2626,color:#450a0a,stroke-width:2px
    

    </details>

    Findings

  • [P3] Feature page still says cleanup and close are no-ops — docs/design/feature/omni_connectors/shared_memory_connector.md:172
  • <details>
    <summary>Evidence for Feature page still says cleanup and close are no-ops</summary>

    The new lifecycle paragraph (shared_memory_connector.md:118) says lock files are removed by cleanup() / close() for keys in _pending_keys. On the same page, §6.2 still says cleanup() is a no-op (line 172) and §6.3 says close() is a no-op that does not recover leaked segments (line 181). At this head, cleanup() unlinks the segment and the lock (shm_connector.py:459-484) and close() runs that for every tracked key, then _close_wakeups()` (lines 497-503). Readers of §6 will follow the opposite contract from §4.3. Update §6.2 and §6.3 to the tracked-key unlink behavior.

    </details>

    ---
    <sub>🤖 This review was generated by InferMatrix Copilot, an open-source repo-maintenance agent for PR review, CI debugging and issue triage. Try it on your own repo, and ⭐ star it if it helped!</sub>

    <!-- omni-reviewbot:v1 repo=vllm-project/vllm-omni pr=7840 head=fb41bce236c7b68be732cf54319d62388be4ffe8 -->

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "cfaf2f450c65479af1a3c8810f43e00c41cf90794d1c8ad6cfd79bfdce065202",
    "backend": "cursor",
    "duration_ms": 1890031,
    "executed_mode": "direct",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "fallback: arm strict/cursor/cursor-grok-4.6-high failed 3x (last: backend); executed on the fallback arm direct/cursor/auto; excluded from the arm analysis; auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "auto",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": "fb41bce236c7b68be732cf54319d62388be4ffe8",
    "terminal_state": "completed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on code on Oct 10, 2026 17:47 UTC
    Code Review
    vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:1
    @@ -244,10 +380,15 @@ def _get_data_with_lock(self, lock_file: str, shm_handle: dict[str, Any]) -> tup
                 logger.error(f"SharedMemoryConnector shm get failed for req : {e}")
                 return None
             finally:
    -            if consumed:
    +            # The lock file has no lifecycle of its own: once the segment is
    +            # gone (consumed by this read, or already reaped elsewhere) the
    +            # lock guarding it must go too.  A failed read with the segment
    +            # still alive keeps the lock — the transfer can be retried.
    +            seg_gone = not os.path.exists(f"/dev/shm/{shm_handle['name']}")
    +            if consumed or seg_gone:

    [P2] seg_gone unlink deletes a lock this get never acquired

    <details>
    <summary>Evidence and suggested fix</summary>

    The new finally in _get_data_with_lock unlinks the lock whenever the segment path is missing, including when LOCK_NB failed. BlockingIOError returns before consumed is set, but finally still runs os.remove(lock_file) when seg_gone is true (shm_connector.py:377-392). That os.remove does not hold flock and does not use the grace / inode recheck in _reclaim_orphan_lock_file.

    put() creates the lock and takes LOCK_EX before shm_write_bytes (lines 337-340), so the segment path is absent for the whole critical section. The metadata branch calls _get_data_with_lock with no prior SharedMemory existence check (lines 442-445). A same-key retry that still holds the lock, or any other LOCK_EX holder while the segment is gone, loses the directory entry: put() can return success, and the next get() fails opening the lock (FileNotFoundError under except Exception) and returns None until cleanup() / close(). The key poll path stays outside this window because _get_by_key only enters _get_data_with_lock after SharedMemory(name) succeeds. test_get_failure_dead_segment_removes_lock_file covers a free lock, not LOCK_NB failure.

    Unlink on seg_gone only after LOCK_NB succeeds. On BlockingIOError, leave the file for the holder; orphan recovery stays on _reclaim_orphan_lock_file / the gated sweep.

    </details>

    yanbao1217 yanbao1217 commented on Oct 11, 2026 04:57 UTC
    Author

    §6.2/§6.3 updated in 9dc222b21 — they now describe the exact-key unlink
    (cleanup() / cleanup_prefix()) and the tracked-key drain + wakeup close,
    consistent with §4.3 and the implementation. The no-op wording was left over
    from before the wakeup rework.

    hsliuustc0106 hsliuustc0106 commented on code on Oct 11, 2026 05:10 UTC
    Code Review
    vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:1
    @@ -244,10 +380,15 @@ def _get_data_with_lock(self, lock_file: str, shm_handle: dict[str, Any]) -> tup
                 logger.error(f"SharedMemoryConnector shm get failed for req : {e}")
                 return None
             finally:
    -            if consumed:
    +            # The lock file has no lifecycle of its own: once the segment is
    +            # gone (consumed by this read, or already reaped elsewhere) the
    +            # lock guarding it must go too.  A failed read with the segment
    +            # still alive keeps the lock — the transfer can be retried.
    +            seg_gone = not os.path.exists(f"/dev/shm/{shm_handle['name']}")
    +            if consumed or seg_gone:

    [P1] Preserve the lock when acquisition fails

    This finally block also runs when flock raises BlockingIOError. During a same-key replacement, a reader can open the old segment, fail to acquire the writer-held lock, and then observe the gap between shm_write_bytes unlinking the old segment and creating its replacement. seg_gone becomes true and the reader removes the active writer's lock; the writer then publishes a segment whose lock path is missing, so subsequent get calls cannot read it. Skip this cleanup when lock acquisition fails, or use the guarded orphan-reclaim helper. Please add a regression covering lock contention plus segment disappearance.

    hsliuustc0106 hsliuustc0106 commented on code on Oct 11, 2026 05:10 UTC
    Code Review
    docs/design/feature/omni_connectors/shared_memory_connector.md:1
    @@ -166,18 +168,13 @@ This path is mainly for older code paths and is not the preferred mode for the c
     `put()` writes every serialized payload to shared memory. The connector has no
     inline-payload path or size threshold.
     
    -#### 6.2 Cleanup Is Currently Passive
    -
    -`cleanup()` is currently a no-op. The intended assumption is:
    -
    -- the consumer reads the segment
    -- the underlying shared-memory helpers unlink it
    +#### 6.2 Cleanup Unlinks the Exact Tracked Key
     
    -If the consumer never executes `get()`, the shared-memory segment may remain allocated. This means the connector relies on the normal success path for resource reclamation.
    +`cleanup(request_id)` unlinks the exact key passed to `put()` — never a request-id prefix — together with its lock file, and returns whether an unconsumed segment was actually unlinked. `cleanup_prefix()` applies the same unlink to every tracked key of the form `{key_prefix}{chunk_id}`. Keys no longer tracked (already consumed, or written by another process) are not touched. A key the consumer never reads and nobody cleans up stays allocated until the sender's `close()`.

    [P2] Correct the documented cleanup ownership guarantee

    The statement that untracked keys, including keys written by another process, are not touched does not hold for cleanup(key). That method pops the bookkeeping entry without checking membership, then opens and unlinks the named segment and removes its lock file regardless of tracking. A fresh connector can therefore delete a key written by another connector. Restrict the tracked-key guarantee to cleanup_prefix() and close(), and describe cleanup(key) as unconditional exact-key cleanup.

    hsliuustc0106 hsliuustc0106 commented on Oct 11, 2026 05:10 UTC
    Reviewer

    Reviewed head 9dc222b213cd4b99b7469cc9771cf88ddbd9a474 against base 639abb2a9fca94f2f2e0be4df184d3f161e46080. Two findings below.

    Validation: SHA-pinned static review and git diff --check completed. Tests were not executed because the fork lacks the sandbox required by the review workflow.

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 11, 2026 06:17 UTC
    Bot

    <details>
    <summary>Omni ReviewBot attempt record</summary>

    Review attempt ended as failed (failed; retrying strict/cursor/cursor-grok-4.6-high in 120s (try 2 of 3)).
    </details>

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "ac0e76133cdbd11d3200b1ca5f813b096d6b1a210d676e59e368e00b24b78997",
    "backend": "cursor",
    "duration_ms": 440282,
    "executed_mode": "strict",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "cursor-grok-4.6-high",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": null,
    "terminal_state": "failed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 11, 2026 06:22 UTC
    Bot

    <details>
    <summary>Omni ReviewBot attempt record</summary>

    Review attempt ended as failed (failed; retrying strict/cursor/cursor-grok-4.6-high in 600s (try 3 of 3)).
    </details>

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "330a1cdcaea1b32a16b16ac2ae00709ee860a88cdf83aa20cd57c74f435eb96f",
    "backend": "cursor",
    "duration_ms": 107971,
    "executed_mode": "strict",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "cursor-grok-4.6-high",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": null,
    "terminal_state": "failed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 11, 2026 06:37 UTC
    Bot

    <details>
    <summary>Omni ReviewBot attempt record</summary>

    Review attempt ended as failed (failed; falling back to direct/cursor/auto).
    </details>

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "8f8bf4706b153bcc6f70b2a29ff359fe1928d8731ac52ebd8c65979385c5c8b5",
    "backend": "cursor",
    "duration_ms": 108587,
    "executed_mode": "strict",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "cursor-grok-4.6-high",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": null,
    "terminal_state": "failed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 11, 2026 06:38 UTC
    Bot

    <details>
    <summary>Omni ReviewBot attempt record</summary>

    Review attempt ended as failed (Cursor exited with 1: ActionRequiredError: You've hit your usage limit You've saved $3501 on API model usage this month with Ultra. Switch to a different model or set a Spend Limit to continue with Auto. Your usage limits will reset when your monthly cycle ends on 10/20/2026.; retrying direct/cursor).
    </details>

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "a162c1f4736e80ec02e1c62425c39742ff6d85d9448ce4f4240d5b3aa9e9b01b",
    "backend": "cursor",
    "duration_ms": 37641,
    "executed_mode": "direct",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "fallback: arm strict/cursor/cursor-grok-4.6-high failed 3x (last: backend); executed on the fallback arm direct/cursor/auto; excluded from the arm analysis; auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "auto",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": null,
    "terminal_state": "failed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 11, 2026 06:43 UTC
    Bot

    <details>
    <summary>Omni ReviewBot attempt record</summary>

    Review attempt ended as failed (Cursor exited with 1: ActionRequiredError: You've hit your usage limit You've saved $3501 on API model usage this month with Ultra. Switch to a different model or set a Spend Limit to continue with Auto. Your usage limits will reset when your monthly cycle ends on 10/20/2026.; retrying direct/cursor).
    </details>

    <!-- omni-reviewbot:mode-result:v1
    {
    "assigned_mode": "strict",
    "assignment_id": "ma1_db2cf97041e378bcc8e314bfb3a7bab8bc772f4d3b4077049ad86ab7389a1e68",
    "attempt_id": "036956bd4471db82fbe79f98e7b87a20313c504322561144c616e1c4215ab59e",
    "backend": "cursor",
    "duration_ms": 35778,
    "executed_mode": "direct",
    "experiment_id": "fleet-strict-cursor-grok46-zcode-glm53flash-5050-c5-z10-20261002",
    "fallback_reason": "fallback: arm strict/cursor/cursor-grok-4.6-high failed 3x (last: backend); executed on the fallback arm direct/cursor/auto; excluded from the arm analysis; auto-review: nightly sweep runs the PR's routing-table arm; excluded from the arm analysis",
    "infermatrix_sha": "infermatrix-copilot==0.2.0",
    "model": "auto",
    "review_depth": "standard",
    "reviewbot_sha": "unknown",
    "reviewed_head_sha": null,
    "terminal_state": "failed"
    }
    -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 19, 2026 04:40 UTC
    Bot

    Omni ReviewBot: no human activity for 7 days

    @yanbao1217 this pull request has had no human commit, comment or review since 2026-10-11. Please confirm the current plan and next step. The author or a maintainer decides whether to change the PR state.

    To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline.

    <!-- omni-reviewbot:stale:v1 repo=vllm-project/vllm-omni pr=7840 window=2026-10-11T05:10:06+00:00 -->
    <!-- omni-reviewbot:quality-note-state:live -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Oct 29, 2026 05:47 UTC
    Bot

    Omni ReviewBot: no human activity for 18 days

    @yanbao1217 this pull request has had no human commit, comment or review since 2026-10-11. Please consider marking this PR as draft until work can resume. The author or a maintainer decides whether to change the PR state.

    To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline.

    <!-- omni-reviewbot:idle:v1 repo=vllm-project/vllm-omni pr=7840 window=2026-10-11T05:10:06+00:00 rung=14 -->
    <!-- omni-reviewbot:quality-note-state:live -->

    vllm-omni-review-bot vllm-omni-review-bot commented on Nov 10, 2026 05:12 UTC
    Bot

    Omni ReviewBot: no human activity for 30 days

    @yanbao1217 this pull request has had no human commit, comment or review since 2026-10-11. Please consider closing this PR if the work is no longer planned. The author or a maintainer decides whether to change the PR state.

    To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline.

    <!-- omni-reviewbot:idle:v1 repo=vllm-project/vllm-omni pr=7840 window=2026-10-11T05:10:06+00:00 rung=30 -->
    <!-- omni-reviewbot:quality-note-state:live -->

    yanbao1217 yanbao1217 commented on code on Nov 28, 2026 08:28 UTC
    Code Review
    vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:1
    @@ -244,10 +380,15 @@ def _get_data_with_lock(self, lock_file: str, shm_handle: dict[str, Any]) -> tup
                 logger.error(f"SharedMemoryConnector shm get failed for req : {e}")
                 return None
             finally:
    -            if consumed:
    +            # The lock file has no lifecycle of its own: once the segment is
    +            # gone (consumed by this read, or already reaped elsewhere) the
    +            # lock guarding it must go too.  A failed read with the segment
    +            # still alive keeps the lock — the transfer can be retried.
    +            seg_gone = not os.path.exists(f"/dev/shm/{shm_handle['name']}")
    +            if consumed or seg_gone:

    Fixed in cf8392c. If the reader cannot acquire the writer's lock, it returns None before checking whether the segment exists or attempting to unlink the lock file. Read path

    The regression test covers the gap you described. With the segment absent and its aged lock held exclusively, a key-only poll leaves the lock file in place. After the holder releases the lock, the next poll reclaims it. The test passed on Linux. Regression test

    yanbao1217 yanbao1217 commented on code on Nov 28, 2026 08:30 UTC
    Code Review
    docs/design/feature/omni_connectors/shared_memory_connector.md:1
    @@ -166,18 +168,13 @@ This path is mainly for older code paths and is not the preferred mode for the c
     `put()` writes every serialized payload to shared memory. The connector has no
     inline-payload path or size threshold.
     
    -#### 6.2 Cleanup Is Currently Passive
    -
    -`cleanup()` is currently a no-op. The intended assumption is:
    -
    -- the consumer reads the segment
    -- the underlying shared-memory helpers unlink it
    +#### 6.2 Cleanup Unlinks the Exact Tracked Key
     
    -If the consumer never executes `get()`, the shared-memory segment may remain allocated. This means the connector relies on the normal success path for resource reclamation.
    +`cleanup(request_id)` unlinks the exact key passed to `put()` — never a request-id prefix — together with its lock file, and returns whether an unconsumed segment was actually unlinked. `cleanup_prefix()` applies the same unlink to every tracked key of the form `{key_prefix}{chunk_id}`. Keys no longer tracked (already consumed, or written by another process) are not touched. A key the consumer never reads and nobody cleans up stays allocated until the sender's `close()`.

    Updated sections 6.2 and 6.3 in cf8392c. Direct cleanup(key) targets the exact key even on a connector that never published it. Prefix cleanup and close() operate on publications tracked by that sender. Cleanup contract

    The prefix cleanup test passed on Linux: it reclaimed the two remaining chunks for one request and the sibling request's payload was still readable. The completion and abort tests also passed when another sender replaced the same key. Prefix test · Same-key tests

    @hsliuustc0106, could you take another look at the lock-contention fix and the revised cleanup contract on cf8392c? Both review threads now point to the corresponding code and tests.

    hsliuustc0106 hsliuustc0106 commented on code on Nov 28, 2026 10:51 UTC
    Code Review
    vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:1
    @@ -382,79 +524,90 @@ def get(
             get_key: str,
             metadata=None,
         ) -> tuple[Any, int] | None:
    -        if metadata is not None:
    -            if isinstance(metadata, dict) and get_key in metadata:
    -                metadata = metadata.get(get_key)
    -
    -            if isinstance(metadata, dict) and "shm" in metadata:
    -                shm_handle = metadata["shm"]
    -                lock_file = self._lock_file(shm_handle["name"])
    -                result = self._get_data_with_lock(lock_file, shm_handle)
    -                if result is not None:
    -                    with self._pending_keys_lock:
    -                        self._pending_keys.pop(get_key, None)
    -            else:
    -                # Missing or non-SHM metadata falls back to key-based lookup.
    -                result = self._get_by_key(get_key)
    -        else:
    -            result = self._get_by_key(get_key)
    +        self._maybe_sweep_stale_lock_files()
    +        return self._get_payload(get_key, metadata, deadline=None)
     
    -        if result is not None:
    -            self._metrics["gets"] += 1
    -        return result
    +    def get_with_deadline(self, from_stage, to_stage, get_key, metadata=None, *, deadline):
    +        """Limit this receive to its own key; a directory sweep has no time bound."""
    +        if time.monotonic() >= deadline:
    +            return None
    +        return self._get_payload(get_key, metadata, deadline=deadline)
     
         def cleanup(self, request_id: str) -> bool:
    -        """Unlink the exact key passed to ``put()``, never a request-id prefix.
    +        """Try to unlink the exact key without waiting. Return True if its segment was removed."""
    +        return self._cleanup_key(request_id, None)
     
    -        Returns True when an unconsumed segment was actually unlinked.
    -        """
    -        key = request_id
    -        unlinked = False
    +    def cleanup_tracked(self, key: str) -> bool:
    +        """Release only the publication this sender has recorded for an aborted transfer."""
             with self._pending_keys_lock:
    -            self._pending_keys.pop(key, None)
    -            try:
    -                self._unlink_segment(self._shm_name(key))
    -                logger.debug("cleanup: unlinked unconsumed SHM segment %s", key)
    -                unlinked = True
    -            except FileNotFoundError:
    -                pass
    -            except Exception as e:
    -                logger.debug("cleanup: failed to unlink SHM segment %s: %s", key, e)
    -            lock_file = self._lock_file(self._shm_name(key))
    -            if os.path.exists(lock_file):
    +            publication = self._pending_keys.get(key)
    +        return publication is not None and self._cleanup_key(key, publication)
    +
    +    def _cleanup_key(self, key: str, publication: _Publication | None) -> bool:
    +        name = self._shm_name(key)
    +        lock_file = self._lock_file(name)
    +        # A name may be reused while we wait. Wait only when the backend can identify our segment.
    +        expected = publication.segment_identity if publication is not None else None
    +        unlinked = False
    +        try:
    +            with _publication_lock(lock_file, blocking=expected is not None) as fd:

    [P1] Keep SHM cleanup from blocking the stage's send queue

    On Linux, an identified publication takes a blocking flock here. Abort and completion cleanup run on the same serial save thread as normal sends. If a live peer stalls while holding request A's lock, unrelated request B can't send its next chunk. The existing contention test releases the writer as soon as cleanup attempts the lock, so it doesn't cover queue progress while the lock remains held.

    Please try the lock without blocking on the send thread and defer busy publications for retry, preserving the original publication identity. Add a regression that keeps A locked until B sends, then checks that deferred cleanup leaves a same-key replacement intact.

    AI assistance: OpenAI ChatGPT assisted with static review and drafting. I did not run the tests.

    hsliuustc0106 hsliuustc0106 commented on Nov 28, 2026 10:51 UTC
    Reviewer

    One remaining concern on the current revision: terminal SHM cleanup can block unrelated sends.

    hsliuustc0106 hsliuustc0106 commented on Nov 28, 2026 11:00 UTC
    Reviewer

    Advisory review score: 40/100 (rubric, base a59b7b9 → head cf8392c).

    | Dimension | Rating | Evidence |
    | --- | ---: | --- |
    | Scope and intent | 3/3 | The diff, tests, and docs focus on SHM lock and segment ownership. |
    | Correctness and safety | 0/3 | P1: tracked cleanup can block unrelated sends. |
    | Validation | 2/3 | Author reports 529 CPU tests passed and 1 skipped. GitHub and docs checks passed; no matching CUDA gate was found. |
    | Claim evidence | N/A | Transport lifecycle fix with no model, quality, or performance claim. |
    | Simplicity | 0/3 | The diff adds explanatory comments in source and tests, triggering the rubric's zero rule. |

    Fix the P1 before merge. Verify that unrelated sends continue while a lock is held and that deferred cleanup preserves a same-key replacement.

    AI assistance: OpenAI ChatGPT assisted with static review and drafting; no tests were run independently.

    yanbao1217 yanbao1217 commented on code on Nov 28, 2026 12:22 UTC
    Code Review
    vllm_omni/distributed/omni_connectors/connectors/shm_connector.py:1
    @@ -382,79 +524,90 @@ def get(
             get_key: str,
             metadata=None,
         ) -> tuple[Any, int] | None:
    -        if metadata is not None:
    -            if isinstance(metadata, dict) and get_key in metadata:
    -                metadata = metadata.get(get_key)
    -
    -            if isinstance(metadata, dict) and "shm" in metadata:
    -                shm_handle = metadata["shm"]
    -                lock_file = self._lock_file(shm_handle["name"])
    -                result = self._get_data_with_lock(lock_file, shm_handle)
    -                if result is not None:
    -                    with self._pending_keys_lock:
    -                        self._pending_keys.pop(get_key, None)
    -            else:
    -                # Missing or non-SHM metadata falls back to key-based lookup.
    -                result = self._get_by_key(get_key)
    -        else:
    -            result = self._get_by_key(get_key)
    +        self._maybe_sweep_stale_lock_files()
    +        return self._get_payload(get_key, metadata, deadline=None)
     
    -        if result is not None:
    -            self._metrics["gets"] += 1
    -        return result
    +    def get_with_deadline(self, from_stage, to_stage, get_key, metadata=None, *, deadline):
    +        """Limit this receive to its own key; a directory sweep has no time bound."""
    +        if time.monotonic() >= deadline:
    +            return None
    +        return self._get_payload(get_key, metadata, deadline=deadline)
     
         def cleanup(self, request_id: str) -> bool:
    -        """Unlink the exact key passed to ``put()``, never a request-id prefix.
    +        """Try to unlink the exact key without waiting. Return True if its segment was removed."""
    +        return self._cleanup_key(request_id, None)
     
    -        Returns True when an unconsumed segment was actually unlinked.
    -        """
    -        key = request_id
    -        unlinked = False
    +    def cleanup_tracked(self, key: str) -> bool:
    +        """Release only the publication this sender has recorded for an aborted transfer."""
             with self._pending_keys_lock:
    -            self._pending_keys.pop(key, None)
    -            try:
    -                self._unlink_segment(self._shm_name(key))
    -                logger.debug("cleanup: unlinked unconsumed SHM segment %s", key)
    -                unlinked = True
    -            except FileNotFoundError:
    -                pass
    -            except Exception as e:
    -                logger.debug("cleanup: failed to unlink SHM segment %s: %s", key, e)
    -            lock_file = self._lock_file(self._shm_name(key))
    -            if os.path.exists(lock_file):
    +            publication = self._pending_keys.get(key)
    +        return publication is not None and self._cleanup_key(key, publication)
    +
    +    def _cleanup_key(self, key: str, publication: _Publication | None) -> bool:
    +        name = self._shm_name(key)
    +        lock_file = self._lock_file(name)
    +        # A name may be reused while we wait. Wait only when the backend can identify our segment.
    +        expected = publication.segment_identity if publication is not None else None
    +        unlinked = False
    +        try:
    +            with _publication_lock(lock_file, blocking=expected is not None) as fd:

    Fixed in 6643812. When terminal cleanup finds a busy SHM lock, the V1 send thread now moves on to the next request. A later retry checks the original segment’s identity before unlinking it.

    The Linux regression holds request A’s lock until request B’s chunk is actually read. It then verifies that cleanup reclaims the original segment or leaves a same-key replacement readable. All four abort/completion and original/replacement combinations passed. All 244 tests in the signed-commit run passed, and the PR checks are green.

    @hsliuustc0106, could you re-review the send-queue fix and its regression test?

    yanbao1217 yanbao1217 commented on Nov 28, 2026 14:13 UTC
    Author

    @hsliuustc0106, could you add the merge-test label to run the Buildkite Omni · Qwen3-Omni Async-Chunk SHM Leak test on the current head (2c8184f)?

    I updated the PR description with the Linux results. All four regressions failed on 6643812 and passed on 2c8184f. All 464 tests across the three related CPU modules also passed. The CUDA job would verify that a running Qwen3-Omni service cleans up its per-request shared-memory segments and lock files after text-only requests.

    yanbao1217 yanbao1217 commented on Nov 28, 2026 15:06 UTC
    Author

    @hsliuustc0106, could you re-review e2ae09f and add the merge-test label so Buildkite runs Omni · Qwen3-Omni Async-Chunk SHM Leak on this commit?

    This revision preserves same-key replacements when the sender cannot identify its original segment and keeps deferred cleanup scheduled after a temporary error. All seven new regression cases failed on the previous commit and passed on this one. The broader Linux CPU suite passed 876 tests, with one skip. All eight checks reported on GitHub passed.

    vllm-omni-review-bot vllm-omni-review-bot commented on Dec 05, 2026 15:24 UTC
    Bot

    Omni ReviewBot: no human activity for 7 days

    @yanbao1217 this pull request has had no human commit, comment or review since 2026-11-28. Please confirm the current plan and next step. The author or a maintainer decides whether to change the PR state.

    To keep it moving, any one of these is enough: push an update, reply to the open blocker, or post the current plan and timeline.

    <!-- omni-reviewbot:stale:v1 repo=vllm-project/vllm-omni pr=7840 window=2026-11-28T15:06:56+00:00 -->
    <!-- omni-reviewbot:quality-note-state:live -->

    Reviewers
    Assignees
    yanbao1217 yanbao1217
    Labels
    risk: low confidence: 90.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 68.2% (HIGH) · Higher = larger blast radius
    68.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 90.8% · Lower = rushed or shallow review
    90.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 6.2% · Safe to merge
    6.2%