Repository navigation
Conversation
Contributor
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 06a2ae88-866c-4343-aaeb-12764af9a5bd) |
Cross-path expiry eviction and a global idle cap prevent craggemini license CLI subprocess failures from leaking kernel.sock pool FDs. Map EMFILE/ENFILE host errors to gemini_host_resource_exhausted so license status does not report subscription unconfigured. Co-authored-by: ted <kuhlmangarry24@gmail.com>
Add dedicated host-resource error sets in Python and Node; pass 503 through checkAdmission, scheduler FAILURES, and routes HOST_ERRORS. License-status returns host_resource_exhausted status, not unconfigured. Co-authored-by: ted <kuhlmangarry24@gmail.com>
Treat FD exhaustion as host infrastructure in gemini-recovery and crag license seat actions, not sandbox or seat binding issues. Co-authored-by: ted <kuhlmangarry24@gmail.com>
cursor
Bot
force-pushed
the
cursor/unix-pool-emfile-fix-45ef
branch
from
November 27, 2026 07:38
44ea8df to
befb827
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1953
问题与结果
在
origin/dev(a6d70adb,VERSION 1.4.236)上确认:scripts/gemini_host_native.py的_UnixConnectionPool仅在acquire(path)时清理同一路径上过期的 keep-alive 套接字;kernel.sock等路径退役后,其它路径桶内的过期 FD 永远不会被关闭。池仅有每路径 8 的上限、无全局空闲上限,长时间运行会导致pipe2/ EMFILE,许可 CLI 失败后被gemini-host.py折叠为license_unconfigured,面板误显「订阅未配置」。修复后:在 acquire/release 的同一把锁下对所有路径执行过期清扫与空桶删除,并强制执行全局空闲上限(默认 128,模块级常量
CONTROL_CONN_POOL_MAX_IDLE_GLOBAL,非环境变量)。许可 CLI 在 EMFILE/ENFILE 等宿主资源错误时返回gemini_host_resource_exhausted(503);后端checkAdmission、调度器FAILURES与routes.mjsHOST_ERRORS透传该码,控制面/准入层不再折叠为license_required/license_unconfigured。前端本轮补充:gemini-environments在 FD 耗尽时不展示「绑定/重新绑定 CRAG 席位」;gemini-recovery将该码归类为宿主故障并展示 Gemini 维护入口。实现
_UnixConnectionPool:_sweep_idle_locked、_enforce_global_cap_locked;常量CONTROL_CONN_POOL_MAX_*/CONTROL_CONN_POOL_IDLE_TTL。HOST_RESOURCE_ERROR_CODES(独立于SANDBOX_ERROR_CODES)、classify_craggemini_license_host_error;license_status使用status: host_resource_exhausted。GEMINI_HOST_RESOURCE_ERROR_CODES/GEMINI_HOST_RESOURCE_MESSAGES;checkAdmission、scheduler.FAILURES、HOST_ERRORS接线。CRAG_LICENSE_HOST_RESOURCE_CODES+gemini-recovery.hostIssues;gemini-account-statusEMFILE/ENFILE 文案。未改动 HTTP 协议、重试策略或在用连接逻辑(仅池内空闲套接字)。
验证
本 head 对应 CI run 45959882265 为 path-filtered 短路径,未覆盖 format/Go/payload 全量检查(不是发版门)。
未在真实多路径
kernel.sock轮换负载下复现 reporter 的cached 100 open 100(无集成环境)。Release notes(≥1.4.237)
gemini_host_resource_exhausted(503)在控制面与准入路径透传,避免误报「订阅未配置」;面板不再引导用户重绑席位,改为指向 Gemini 维护/重启宿主。Note
Medium Risk
Touches long-running connection pooling and license error classification paths that affect when Gemini sessions are admitted and how failures are shown; behavior change is intentional but could alter responses for previously mislabeled exhaustion cases.
Reviewed by Cursor Bugbot for commit befb827. Configure here.