Slurm: endpoint ports can collide with ephemeral readiness connections
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bash, linux, python
- 领域
- backend, networking, testing
调研方向
Read packages/data-designer-slurm/src/data_designer/slurm/runtime/ports.py, preflight.py, and entrypoint.sh; trace port selection, reservation cleanup, and readiness polling. Start by reproducing the supplied socket-level MRE, then inspect related issue #868 and existing regression tests. Done means startup avoids the probe and listener race, with tests for overlapping ephemeral ranges, occupied ports, and preserved failure diagnostics.
由索引模型根据 Issue 内容生成。
描述
Priority Level
High (Major functionality broken)
Describe the bug
Slurm's allocation-local port selection can overlap Linux's ephemeral TCP port range. A readiness probe issued before the logical endpoint binds can automatically select that endpoint's port as its own source port, connect to itself, and leave the port in TIME_WAIT. The endpoint then fails with EADDRINUSE, even though the earlier bind preflight succeeded and no other listener was needed.
Steps/Code to reproduce bug
Requirements: Linux with unprivileged user/network namespaces, Bash, Python 3, curl, and iproute2 (ip, ss). No Slurm, GPU, model, dataset, or DataDesigner installation is required for this socket-level MRE.
Save the following as repro.sh and run bash repro.sh. It changes sysctls only after entering a private network namespace. A synthetic one-port ephemeral range makes the source-port choice deterministic; it is not a suggested host configuration.
#!/usr/bin/env bash
set -euo pipefail
export MRE_PARENT_NETNS="$(readlink /proc/self/ns/net)"
export MRE_PYTHON="${MRE_PYTHON:-python3}"
unshare --user --map-root-user --net bash <<'SH'
set -euo pipefail
ip link set lo up
"$MRE_PYTHON" - <<'PY'
import errno
import os
import socket
import subprocess
from pathlib import Path
assert str(Path("/proc/self/ns/net").readlink()) != os.environ["MRE_PARENT_NETNS"]
settings = Path("/proc/sys/net/ipv4")
settings.joinpath("ip_local_reserved_ports").write_text("\n")
# Synthetic single-port range forces an otherwise intermittent source-port choice.
settings.joinpath("ip_local_port_range").write_text("10000 10000\n")
# Mirror the preflight bind-and-release before the endpoint starts.
with socket.socket() as reservation:
reservation.bind(("0.0.0.0", 10000))
print("Preflight bind succeeded; reservation released.", flush=True)
probe = subprocess.run(
["curl", "--noproxy", "*", "--fail", "--silent", "--show-error",
"--max-time", "1", "http://127.0.0.1:10000/health"],
capture_output=True, text=True,
)
print(probe.stderr.strip())
subprocess.run(["ss", "-tan", "( sport = :10000 )"], check=True)
with socket.socket() as listener:
listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
try:
listener.bind(("127.0.0.1", 10000))
except OSError as error:
assert error.errno == errno.EADDRINUSE
print(f"Endpoint bind failed: {error}")
else:
raise AssertionError("Expected EADDRINUSE after the readiness self-connection")
with socket.socket() as control:
control.bind(("127.0.0.1", 2000))
print("Control bind outside the synthetic ephemeral range succeeded.")
PY
SH
Observed:
- The preflight bind succeeds and releases its socket.
- Curl reports
Received HTTP/0.9 when not allowedafter connecting to itself. ssshowsTIME-WAITfrom127.0.0.1:10000to127.0.0.1:10000.- The subsequent endpoint bind raises
[Errno 98] Address already in use, including withSO_REUSEADDRenabled. - The control bind outside the synthetic ephemeral range succeeds.
Expected behavior
Endpoint startup should not allow readiness probes to consume the endpoint's own port. Allocation should account for the host's effective ephemeral/reserved port ranges, and startup should establish listener ownership before connection-based readiness polling can race it.
Agent Diagnostic / Prior Investigation
Affected code was verified at public commit 68c516f724ee1e0e3e3c5a965388a9610e587207. The public feat/slurm-execution branch still uses the same fixed-range allocation:
- Port selection:
10000 + min(SLURM_JOB_GPUS) * 256, without excluding the host ephemeral range. - Preflight: test-bind reservations are closed before startup.
- Startup ordering: servers become ready before endpoint processes start.
- Readiness polling: curl starts polling without first establishing that the endpoint owns its listening socket.
The unmodified DD proxy also reproduces the bind failure under the same forced-collision setup. The MRE establishes a failure mechanism and deliberately forces the timing/source-port choice; it does not measure its frequency under an ordinary host configuration.
Additional context
Related to #868. Regression coverage should include a probe before the listener binds, overlapping ephemeral/service ranges, and an already occupied port. Occupied-port failures should remain explicit and cleanup should preserve the failed attempt's diagnostics.
Checklist
- I reproduced this issue or provided a minimal example
- I searched the docs/issues myself, or had my agent do so
- If I used an agent, I included its diagnostics above
- 主要语言
- Python
- 星标
- 2.4k
- 派生
- 241
- 平均合并
- 1 天 19 分钟
- 30 天内合并 PR
- 84
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA-NeMo/DataDesigner 的其他 Issue
-
Local seed path containing a single quote breaks the DuckDB query可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 67/100
NVIDIA-NeMo/DataDesigner#1102 · 2 条评论 ·
维护者通常 1 天内回复
-
Code validation repeats the first result for subsequent target columns可能已有人在做 @edjson 今天认领。 未关闭bug triaged
难度 2/5 1-3 小时 新手友好度 77/100
NVIDIA-NeMo/DataDesigner#1092 · 2 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
enforce \from future import annotations` via ruff FA102 rule`可能已有人在做 @chethanuk 于 48 天前认领。 未关闭task
难度 2/5 1-3 小时 新手友好度 82/100
NVIDIA-NeMo/DataDesigner#760 ·
维护者通常 1 天内回复
-
Complete Slurm proxy health integration, draining, telemetry, and overload validation可能已有人在做 @nabinchha 今天认领。 未关闭task
NVIDIA-NeMo/DataDesigner#1103 · 已指派 1 人 ·
维护者通常 1 天内回复
-
task
难度 5/5 一周以上 新手友好度 38/100
NVIDIA-NeMo/DataDesigner#1094 ·
维护者通常 1 天内回复
查看 NVIDIA-NeMo/DataDesigner 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/agent-lightning#661 ·
维护者通常 2 天内回复
-
area/profiles comp/cli P3 type/feature
难度 2/5 1-3 小时 新手友好度 74/100
NousResearch/hermes-agent#146372 ·
维护者通常 1 天内回复
-
[BUG] OpenAI-compatible embedding model alias breaks embedder construction可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistencies可能已有人在做 @github-actions 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
GeoSeries scale and skew tests fail with pytest 9.2.0可能已有人在做 @jiayuasu 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复