Skip to content

fix(k8s): FailedScheduling errors for fast-fail and Hint#26

Open
Longwt123 wants to merge 2 commits into
release/no_volumesfrom
fix/scheduling-fast-fail
Open

fix(k8s): FailedScheduling errors for fast-fail and Hint#26
Longwt123 wants to merge 2 commits into
release/no_volumesfrom
fix/scheduling-fast-fail

Conversation

@Longwt123

@Longwt123 Longwt123 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

描述

问题:FailedScheduling 被无差别 fast-fail,资源不足排队也立即报错。
根源:UNRECOVERABLE_EVENT_REASONS 含 FailedScheduling,但 FailedScheduling 有两种:

  • 临时(资源不足 Insufficient )→ 应该等
  • 永久(配置错误:selector/taint 不匹配)→ 应该 fast-fail (一般不会发生,无需监控)

修改:

  • GPU 资源不足的 job → 应该排队等待(不再立即 fast-fail)
  • 补充对每种错误的建议排查方向
  • readPod 网络抖动 → 打 warning 后自动重试

测试:
61 测试全过

相关 Issue

resolve https://github.com/opensourceways/backlog/issues/1203

变更类型

  • Bug 修复
  • 新功能
  • 代码重构
  • 文档更新
  • 样式改进
  • 性能优化
  • 测试相关
  • 其他

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@opensourceways-bot

Copy link
Copy Markdown

Welcome To opensourceways Community

Hey @Longwt123 , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: infratructure ,
and any of the maintainers: @GeorgeCao-hw, @TangJia025, @pkking, @zhongjun2 ,
and any of the committers: @GeorgeCao-hw, @Goalina, @Hourunze1997, @JavaPythonAIForBAT, @KadenZhang3321, @LiYanghang00, @ccijunk, @drizzlezyk, @githubliuyang777, @pkking, @rosecoffe, @tfhddd, @yao-xiaobai, @zhongjun2, @zkhzkhz .

@opensourceways-bot

Copy link
Copy Markdown

CLA Signature Pass

Longwt123, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@opensourceways-bot

Copy link
Copy Markdown
检查项 状态
敏感信息扫描
安全编码扫描
漏洞扫描
开源license合规扫描
UT测试覆盖率
开发阶段设计文档检查
流水线链接 点击跳转查看日志

@opensourceways-bot

Copy link
Copy Markdown

CLA Signature Pass

Longwt123, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@Longwt123

Copy link
Copy Markdown
Collaborator Author

/retest

@opensourceways-bot

Copy link
Copy Markdown
检查项 状态
敏感信息扫描
安全编码扫描
漏洞扫描
开源license合规扫描
UT测试覆盖率
开发阶段设计文档检查
流水线链接 点击跳转查看日志

@opensourceways-bot

Copy link
Copy Markdown
检查项 状态
敏感信息扫描
安全编码扫描
漏洞扫描
开源license合规扫描
UT测试覆盖率
开发阶段设计文档检查
流水线链接 点击跳转查看日志

@opensourceways-bot

Copy link
Copy Markdown

CLA Signature Pass

Longwt123, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@Longwt123

Copy link
Copy Markdown
Collaborator Author

/retest

@opensourceways-bot

Copy link
Copy Markdown
检查项 状态
敏感信息扫描
安全编码扫描
漏洞扫描
开源license合规扫描
UT覆盖率
开发阶段设计文档检查
流水线链接 点击跳转查看日志

@opensourceways-bot

Copy link
Copy Markdown
检查项 状态
敏感信息扫描
安全编码扫描
漏洞扫描
开源license合规扫描
UT覆盖率
开发阶段设计文档检查
流水线链接 点击跳转查看日志

@Longwt123 Longwt123 changed the title fix(k8s): whitelist permanent scheduling errors for fast-fail fix(k8s): FailedScheduling errors for fast-fail and Hint Jul 8, 2026
@opensourceways-bot

Copy link
Copy Markdown

Notification

This pull request source branch has changed, so removes the following label(s): gate_check_pass.

@opensourceways-bot

Copy link
Copy Markdown

CLA Signature Pass

Longwt123, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@opensourceways-bot

Copy link
Copy Markdown
检查项 状态
敏感信息扫描
安全编码扫描
漏洞扫描
开源license合规扫描
UT覆盖率
开发阶段设计文档检查
流水线链接 点击跳转查看日志

Longwt123 and others added 2 commits July 8, 2026 17:16
…on readPod failure

Problem: FailedScheduling / Unschedulable fast-failed on ANY unrecognised
message, including transient resource shortages (Insufficient gpu/cpu/memory)
and unknown kube-scheduler message formats. This broke GPU workflow queuing.
Also, a transient readPod() failure crashed the waitForPodPhases loop with
no diagnostics (Risk A).

Changes:
- Replace blacklist (skip if 'Insufficient') with whitelist (fast-fail ONLY
  if message matches PERMANENT_SCHEDULING_PATTERNS):
    * node(s) didn't match Pod's node affinity/selector
    * node(s) didn't match node affinity
    * node(s) had untolerated taint
  Unknown messages, absent messages, resource shortages all → queue to timeout.
- Add isPermanentSchedulingFailure() / getPermanentSchedulingPatterns()
  (replaces isTransientSchedulingFailure). Extendable at runtime via
  ACTIONS_RUNNER_K8S_PERMANENT_SCHEDULING_PATTERNS env var (CSV regexes).
- Apply same whitelist logic to getPodConditionErrors (Unschedulable).
- Remove dead pre-scan block in getPodEventErrors.
- Wrap readPod() in waitForPodPhases with try/catch: transient read failures
  now log a warning and back off rather than crashing the loop. Timeout
  produces a message that includes the read error.
- 48 tests, all passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… hints

- Remove FailedScheduling from UNRECOVERABLE_EVENT_REASONS entirely;
  scheduling failures are always transient resource waits, never fast-fail
- Remove PERMANENT_SCHEDULING_PATTERNS, isPermanentSchedulingFailure,
  getPermanentSchedulingPatterns, getPodConditionErrors (Unschedulable)
- Add getWaitingReasonHint: ImagePullBackOff/ErrImagePull with registry,
  imagePullSecret, and network connectivity guidance; others with targeted hints
- Add getTerminatedReasonHint: Error reason split by exit code (137=SIGKILL,
  139=SIGSEGV, 126=no exec permission, 127=command not found, other=generic)
- Add getEventReasonHint: FailedMount and FailedBinding with kubectl checklist
- Update tests: 47 passing, use toContain assertions resilient to hint wording

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@opensourceways-bot

Copy link
Copy Markdown

Notification

This pull request source branch has changed, so removes the following label(s): gate_check_pass.

@opensourceways-bot

Copy link
Copy Markdown

CLA Signature Pass

Longwt123, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@opensourceways-bot

Copy link
Copy Markdown
检查项 状态
敏感信息扫描
安全编码扫描
漏洞扫描
开源license合规扫描
UT覆盖率
开发阶段设计文档检查
流水线链接 点击跳转查看日志

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants