← Back to Pull requests

add event handlers registration #417

Closed
unknown closed this pull request without merging on Aug 05, 2024 10:27 UTC
View on GitHub
unknown unknown commented on Aug 03, 2024 10:20 UTC
Author

What type of PR is this?

/kind feature

What this PR does / why we need it:

Current, if a pod schedule fails, it's too difficult to troubleshoot, because the pod doesn't have the scheduler event .

This feature wants to add the scheduler process(filter and binding) event to accolated the pod

Sure. Currently, the event of all filters and bindings that do not meet the conditions are not detailed enough. They can be enhance later.

Test results

If a pod scheduler succeed, we can describe the pod

(base) ➜  scheduler git:(master) ✗ kubectl describe  po nginx-deployment-7bd89f854c-5p2xv
Name:             nginx-deployment-7bd89f854c-5p2xv
Namespace:        default
Priority:         0
Service Account:  default
...
...
...
Events:
  Type    Reason            Age   From            Message
  ----    ------            ----  ----            -------
  Normal  Scheduled         6s    hami-scheduler  Successfully assigned default/nginx-deployment-67f97f4d9d-wtzzd to controller-node-1
  Normal  FilteringSucceed  7s    hami-scheduler  Successfully filtered to following nodes: [controller-node-1] for default/nginx-deployment-67f97f4d9d-wtzzd
  Normal  BindingSucceed    7s    hami-scheduler  Successfully binding node [controller-node-1] to default/nginx-deployment-67f97f4d9d-wtzzd
  Normal  Pulling           6s    kubelet         Pulling image "docker.m.daocloud.io/nginx:latest"
  Normal  Pulled            5s    kubelet         Successfully pulled image "docker.m.daocloud.io/nginx:latest" in 1.075344559s (1.075360343s including waiting)
  Normal  Created           5s    kubelet         Created container nginx
  Normal  Started           5s    kubelet         Started container nginx

###If a pod scheduler failed, we can describe the pod to quickly troubleshoot

(base) ➜  scheduler git:(master) ✗ kubectl describe po nginx-deployment-8dc9c4774-txbzf
Name:             nginx-deployment-8dc9c4774-txbzf
Namespace:        default
Priority:         0
...
...
...
Events:
  Type     Reason            Age   From            Message
  ----     ------            ----  ----            -------
  Warning  FailedScheduling  8s    hami-scheduler  0/2 nodes are available: 1 node(s) had untolerated taint {node.kubernetes.io/unreachable: }. preemption: 0/2 nodes are available: 1 No preemption victims found for incoming pod, 1 Preemption is not helpful for scheduling.
  Warning  FilteringFailed   9s    hami-scheduler  no available node, all node scores do not meet

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Diff: 336 lines (+252 / -84) across 4 files Reviewer: wawa0210 Review duration: 2886m
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.42 · 336 lines diff across 4 files
0.42
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.348
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #417"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 42.2% (MEDIUM) · Higher = larger blast radius
42.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 16.7% · Safe to merge
16.7%