parseK8sCPU parses a Kubernetes CPU string (e.g., "46", "46000m", "500m") into a whole thread count. Millicores below 1000 round down to 0.
(s string)
| 1486 | // client FIN/RST, or drain canceled its context. Never retain that raced |
| 1487 | // session without a live client to own it. |
| 1488 | if executor != nil { |
| 1489 | if createdPID == 0 { |
| 1490 | createdPID = pid |
| 1491 | } |
| 1492 | sessions.DestroySession(createdPID) |
| 1493 | } |
| 1494 | outcome, reason := controlPlaneSessionStartResult(err) |
| 1495 | sessionStart.Finish(outcome, reason) |
| 1496 | clog.Error("Failed to create session.", "error", err) |
| 1497 | code, message := sessionCreationErrorResponse(err) |
| 1498 | _ = server.WriteErrorResponse(writer, "FATAL", code, message) |
| 1499 | _ = writer.Flush() |
| 1500 | return |
| 1501 | } |
| 1502 | // Worker is now assigned — capture identity for log correlation. |
| 1503 | sessionEverCreated = true |
| 1504 | workerID = sessions.WorkerIDForPID(pid) |
| 1505 | workerPod = sessions.WorkerPodNameForPID(pid) |
| 1506 | clog = clog.With("worker", workerID, "worker_pod", workerPod) |
| 1507 | sessionMeta.clog = clog |
| 1508 | if orgID != "" { |
no outgoing calls