{"record":{"id":"1c44a4a87c0ff046","repo":"vllm-project/vllm","slug":"request-req-id-is-not-in-unfinished-requests","errorCode":null,"errorMessage":"Request {req_id} is not in _unfinished_requests","messagePattern":"Request (.+?) is not in _unfinished_requests","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/scheduler.py","lineNumber":301,"sourceCode":"                        block_hashes=request_real.block_hashes,\n                        is_last_chunk=(\n                            request_tracker.token_len >= last_chunk_tokens_num\n                        ),\n                    )\n                else:\n                    # Decode/chunked request\n                    request_tracker = self._request_trackers[req_id]\n                    num_new_tokens = scheduler_output.num_scheduled_tokens[req_id]\n                    req_tuple = self._unfinished_requests.get(req_id)\n                    if req_tuple:\n                        unfinished_req = req_tuple[0]\n                        num_current_tokens = request_tracker.token_len\n                        new_token_ids = unfinished_req.all_token_ids[\n                            num_current_tokens : num_current_tokens + num_new_tokens\n                        ]\n                        request_tracker.token_len += len(new_token_ids)\n                    else:\n                        raise ValueError(\n                            f\"Request {req_id} is not in _unfinished_requests\"\n                        )\n                    num_computed_token = cached_reqs.num_computed_tokens[i]\n                    # Use the tracker's snapshot of the prefill range so resumed\n                    # requests keep saving past the original prompt boundary.\n                    prefill_end = request_tracker.prefill_end_tokens\n                    if num_computed_token >= prefill_end:\n                        continue\n                    request_tracker.update(new_block_ids)\n\n                    last_chunk_tokens_num = (\n                        prefill_end // self._block_size * self._block_size\n                    )\n                    req_meta = ReqMeta.from_request_tracker(\n                        request_tracker,\n                        self._block_size,\n                        load_spec=None,\n                        skip_save=force_skip_save,","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/distributed/kv_transfer/kv_connector/v1/mooncake/store/scheduler.py#L283-L319","documentation":"In MooncakeStoreScheduler's schedule hook, a scheduled decode/chunked-prefill request id was not found in _unfinished_requests. The code path first tracks new prefill requests; any other scheduled request must already be present, so a miss means the request finished (or was preempted/resumed) between scheduler bookkeeping and this lookup — an invariant break rather than an expected condition.","triggerScenarios":"A request disappears from _unfinished_requests (finished, aborted, or preempted-and-rebuilt) while scheduler_output still lists it in scheduled_tokens; or resumed/preempted requests whose ids are not re-registered in the unfinished map on the path that reaches the decode branch.","commonSituations":"Request abortion racing with the KV-transfer scheduler hook; chunked prefill with preemption; version regressions in the scheduler-connector interaction after upgrading vLLM.","solutions":["Upgrade vLLM to the latest release — this is an internal consistency bug, not a user config error","Check server logs for the same req_id being finished/aborted in the same step (preemption or abort storm) and report the sequence in a vLLM issue","As a workaround, avoid request preemption while MooncakeStoreConnector is active (disable preemption mode that evicts active requests) until fixed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    process_scheduler_output(scheduler_output)\nexcept ValueError as e:\n    if \"not in _unfinished_requests\" in str(e):\n        logger.warning(\"store scheduler desync on abort/preempt; skipping step\")\n    else:\n        raise","preventionTips":["Pin the vLLM version once a MooncakeStoreConnector deployment is validated","Avoid preemption-heavy workloads with this connector until verified on your version","Report reproducible occurrences (req_id + scheduler step) upstream — it indicates an internal desync"],"tags":["mooncake","kv-transfer","scheduler","race-condition","internal-bug"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}