Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
While a new SF Compute node is starting, SF Compute already lists it as
running, but for a few secondsGET /integrations/brev/v1/instances/{id}/sshanswers404("SSH details not currently available").ListInstancesleaves the node out of the list, and dev-plane reads a node missing from the list asterminated. The environment moves toinstance_lost, and when dev-plane handles that change twice, on toterminated, which is final. Setup never runs, the console hides Delete, and the VM keeps running and billing. This hit 9 SF Compute environments since Oct 31 (BREV-13508).Root cause
getSSHInforeturns every SSH lookup error to its caller.ListInstancesskips any node whose lookup fails ("skipping instance due to SSH error"), andGetInstancereturns the error. A404right after creation means the SSH details aren't ready yet, not that the node is gone, but the code treats both the same.Changes
v1/providers/sfcomputev2/instance.go:getSSHInfonow takes theinstanceResponse. If the SSH lookup returns404and the node was created less thansshDetailsPendingWindow(45 min) ago, it logssfcv2: SSH details not available yet, reporting instance as pendingand returns no SSH details instead of an error. The node stays inListInstances, andGetInstancestops failing.sfcInstanceToBrevInstancereports arunningnode with no SSH hostname aspending, since Brev can't reach it yet.v1/providers/sfcomputev2/instance_test.go: three new tests.runningnode whose SSH answer has no hostname is nowpendingat any age (before:runningwith no address).github.com/brevdev/cloudbump. There,pendingdoesn't move an environment (only a change toterminateddoes), the poll rate doesn't depend on status, and time inpendingisn't billed (a few seconds per new node).Test
TestIsSSHDetailsPending: a404inside the window counts as pending; a404at or after the window, a500, or a transport error doesn't.TestListInstancesKeepsNewInstanceWithoutSSHDetailsAsPending(fake SF Compute API): a new node with an SSH404is listed aspendingwith no IP, a ready node isrunningwith its SSH address, and a node older than the window with an SSH404is still left out.TestGetInstanceReportsNewInstanceWithoutSSHDetailsAsPending:GetInstancereturnspendinginstead of an error for a new node with an SSH404.go test ./v1/providers/sfcomputev2/ -race -count=1passes, and golangci-lint v2.6.0 (CI's version, run with Go 1.25.10) reports 0 issues.validation_test.gowere not run.