From 9c29e20069a47c62c0d28a9458d561fb8b1bd1e3 Mon Sep 17 00:00:00 2001 From: shaolila Date: Sat, 11 Jul 2026 20:42:24 +0800 Subject: [PATCH] fix(api): include exhaustion reason in Node exhausted placement warning PlaceSandbox logs "Node exhausted, trying another node" whenever the orchestrator returns codes.ResourceExhausted, but the gRPC error was silently dropped. The orchestrator has two distinct limits: - max running sandboxes per node (MaxSandboxesPerNode flag) - max concurrent sandbox starts (MaxStartingInstancesPerNode, default 3) Both return ResourceExhausted with different messages, and without the error there is no way to tell which limit was hit from the API logs. Add zap.Error(utils.UnwrapGRPCError(err)) to the Warn call, matching the pattern already used in the default (hard failure) branch below. Fixes: https://github.com/e2b-dev/infra/issues/3278 --- packages/api/internal/orchestrator/placement/placement.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api/internal/orchestrator/placement/placement.go b/packages/api/internal/orchestrator/placement/placement.go index 4ad0ef292a..1f4cd7ebe8 100644 --- a/packages/api/internal/orchestrator/placement/placement.go +++ b/packages/api/internal/orchestrator/placement/placement.go @@ -149,7 +149,7 @@ func PlaceSandbox( switch statusCode { case codes.ResourceExhausted: failedNode.PlacementMetrics.Skip(sbxRequest.GetSandbox().GetSandboxId()) - logger.L().Warn(ctx, "Node exhausted, trying another node", logger.WithSandboxID(sbxRequest.GetSandbox().GetSandboxId()), logger.WithNodeID(failedNode.ID)) + logger.L().Warn(ctx, "Node exhausted, trying another node", logger.WithSandboxID(sbxRequest.GetSandbox().GetSandboxId()), logger.WithNodeID(failedNode.ID), zap.Error(utils.UnwrapGRPCError(err))) default: nodesExcluded[failedNode.ID] = struct{}{} failedNode.PlacementMetrics.Fail(sbxRequest.GetSandbox().GetSandboxId())