fix(login): socks5h 不再被降级(#35) + events 调度诊断#39
Open
tianyilt wants to merge 1 commit into
Open
Conversation
#35: login_with_cas 里 proxy.replace("socks5h://","socks5://") 会悄悄关掉 远程 DNS 解析。只能靠代理解析 qz.sii.edu.cn 的环境(WSL/VPN)因此登录失败。 主 API 路径早已正确透传 socks5h://,只有 login 这一处多此一举——直接用原始 proxy。 借鉴 InspireSkill 的调度诊断,补齐碎卡闭环最后一环(看碎卡→exclude→提交→ 若还排队,说出为什么): - api: get_job_events_with_cookie(job 级,含 Unschedulable) + get_job_instance_events_with_cookie(pod 级 FailedScheduling/Evict/Preempted, 复用 _resolve_pod_names)。统一端点 POST /api/v1/train_job/events/list, 按 filter.object_type 区分,真机验证字段。 - cli: 新 `qzcli events <job> [--reason/--type/--tail/--all-instances/--json]`; cmd_status 对排队态 best-effort 多打一行「排队原因: <reason> — <message>」。 - tests: test_login_proxy(3) + test_job_events(20),全绿。 Fixes #35 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
两件事
1. 修 #35 — 登录不再把
socks5h://降级成socks5://login_with_cas(qzcli/api.py)里有一行proxy.replace("socks5h://", "socks5://"),把用户显式配的socks5h://(DNS 走代理)悄悄降成socks5://(本机解析 DNS)。在只能靠代理解析qz.sii.edu.cn的环境(WSL/VPN)下,登录直接连不上。主 API 路径(
_get_pool_manager)早已把原始socks5h://正确交给SOCKSProxyManager,requests(依赖 PySocks)也原生支持 socks5h——只有 login 这一处多此一举。修复:删掉 replace,直接用原始 proxy。2. 借鉴 InspireSkill 的调度诊断(
qzcli events)补齐碎卡治理闭环的最后一环:看碎卡 →
--exclude-node→ 提交 → 若还排队,直接说出为什么排不上。get_job_events_with_cookie(任务/控制器级,含Unschedulable)+get_job_instance_events_with_cookie(Pod 级FailedScheduling/Evict/Preempted,复用已有_resolve_pod_names)。统一端点POST /api/v1/train_job/events/list,按filter.object_type=job|instance区分——已真机验证端点与字段。qzcli events <job> [--reason/--type/--tail/--all-instances/--json];qzcli status <排队 job>自动多打一行排队原因: <reason> — <message>(仅排队/等待态、best-effort,不打断主流程)。测试
tests/test_login_proxy.py(3):socks5h/socks5/无代理下session.proxies保持不被改写。tests/test_job_events.py(20):端点/body/headers、401 与 code≠0 报错、空事件降级、--reason/--type/--tail过滤、--all-instances合并、--json、status 排队诊断行(运行态不额外请求)。python3 -m unittest discover -s tests通过(184,skip 3)。Fixes #35