Skip to content

Commit 4c09528

Browse files
committed
fix: set a timeout for SideroLink provision API call
Set a global timeout for SideroLink Provision API calls to ensure we can retry failures. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent 75e4c4a commit 4c09528

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/app/machined/pkg/controllers/siderolink/manager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ func (ctrl *ManagerController) provision(ctx context.Context, r controller.Runti
349349
nodeUUID := sysInfo.TypedSpec().UUID
350350

351351
provision := func() (*pb.ProvisionResponse, error) {
352+
// set a timeout for the provisioning call
353+
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
354+
defer cancel()
355+
352356
conn, connErr := grpc.NewClient(
353357
cfg.TypedSpec().Host,
354358
withTransportCredentials(cfg.TypedSpec().Insecure),

0 commit comments

Comments
 (0)