-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adds server for desktop process to monitor parent #1109
adds server for desktop process to monitor parent #1109
Conversation
cmd/launcher/desktop.go
Outdated
response.Body.Close() | ||
} | ||
|
||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we potentially want to wait for maybe ~3 consecutive errors, maybe with a small amount of backoff? Just so that launcher being slow to respond once doesn't immediately kill the desktop process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some retries, I started to add a backoff ... but it's fussy to test so I gave up. You think retries is enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I was worried about something like this too - we could end up with the opposite problem, where desktop/menubar can vanish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test this, but it seems fine
cmd/launcher/desktop.go
Outdated
|
||
if errCount < maxErrCount { | ||
|
||
backOff := interval + (interval * time.Duration(errCount)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine, but is also a bit overkill for maxErrCount = 3
"github.com/kolide/kit/ulid" | ||
) | ||
|
||
type monitorServer struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love the name monitorServer
but okay
…th error or non 200 response
5258d45
LGTM! The connection re-use is nifty. |
1 similar comment
LGTM! The connection re-use is nifty. |
Updates desktop runner to create a local server that desktop processes can use to determine if parent still around. A new endpoint is added to the mux for each desktop process, then passed when spawning the process. If the desktop process does not get a response back from that endpoint, it exits.