Skip to content

Conversation

@scott-cotton
Copy link
Member

depends on https://github.com/signadot/signadot/pull/6457 and signadot/go-sdk#76

previously, the api re-claimed on renewal, creating a corner case hole where more than 1 local connect could be running at the same time.

Please review https://github.com/signadot/signadot/pull/6457 for details and explanation of the flow and what has been tested.

Side Effects

This change removed the need for dynamic session id updates.

Misc Fixes

The check for --cluster was pushed to earlier to avoid the possibility of registering and claiming a devbox and then failing due to a mis-specified cluster.

depends on signadot/signadot#6457 and signadot/go-sdk#76

previously, the api re-claimed on renewal, creating a corner case hole
where more than 1 local connect could be running at the same time.

Please review signadot/signadot#6457 for details
and explanation of the flow and what has been tested.

Side Effects

This change removed the need for dynamic session id updates.

Misc Fixes

The check for --cluster was pushed to earlier to avoid the possibility
of registering and claiming a devbox and then failing due to a mis-specified
cluster.
}
}

func (sbw *sbmWatcher) readStream(ctx context.Context,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should simplify this func, and go back to the original implementation:

func (sbw *sbmWatcher) readStream(ctx context.Context,
sbwClient tunapiv1.TunnelAPI_WatchLocalSandboxesClient) {
for {
event, err := sbwClient.Recv()
if err == nil {
sbw.setSuccess(ctx)
sbw.processStreamEvent(event)
continue
}
// just return if the context has been cancelled
select {
case <-ctx.Done():
return
default:
}
// extract the grpc status
grpcStatus, ok := status.FromError(err)
if !ok {
sbw.setError("sandboxes watch grpc stream error: no status", err)
break
}
switch grpcStatus.Code() {
case codes.OK:
sbw.log.Debug("sandboxes watch error code is ok")
sbw.processStreamEvent(event)
continue
case codes.Internal:
sbw.setError("sandboxes watch internal grpc error", err)
<-time.After(3 * time.Second)
case codes.Unimplemented:
sbw.setError(SandboxesWatcherUnimplemented, nil)
// in this case, check again in 1 minutes
<-time.After(1 * time.Minute)
default:
sbw.setError("sandbox watch error", err)
<-time.After(3 * time.Second)
}
break
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This func is unused.

Copy link
Contributor

@daniel-de-vera daniel-de-vera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just left a few comments.

@scott-cotton scott-cotton merged commit 5ca9f32 into main Dec 15, 2025
@scott-cotton scott-cotton deleted the renew-with-session-id branch December 15, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants