Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func TestNexClient_CloneWorkload(t *testing.T) {
be.NilErr(t, err)
defer nc.Close()

client, err := NewClient(context.Background(), nc, "user", WithAuctionStall(1*time.Second))
client, err := NewClient(context.Background(), nc, "user", WithAuctionStall(5*time.Second))
be.NilErr(t, err)
be.Nonzero(t, client)

Expand Down
2 changes: 1 addition & 1 deletion handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ func (n *NexNode) handleStopWorkload() func(micro.Request) {
err = r.RespondJSON(ret)
if err != nil {
n.logger.Error("failed to respond to stop workload request", slog.String("err", err.Error()))
return
}
return
}

msgs(func(m *nats.Msg, e error) bool {
Expand Down
6 changes: 3 additions & 3 deletions internal/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ func (a *AgentWatcher) StartLocalBinaryAgent(ap *AgentProcess, regCreds *models.

ap.agentLock.Unlock()

state, err := cmd.Process.Wait()
err = cmd.Wait()
if err != nil {
a.logger.Error("Nexlet process exited with error", slog.Int("process", ap.Process.Pid), slog.String("err", err.Error()))
} else if state != nil && ap.state != models.AgentStateStopping || ap.state != models.AgentStateLameduck {
a.logger.Warn("Nexlet process unexpectedly exited with state", slog.Any("state", state), slog.Int("process", ap.Process.Pid))
} else if cmd.ProcessState != nil && ap.state != models.AgentStateStopping && ap.state != models.AgentStateLameduck {
a.logger.Warn("Nexlet process unexpectedly exited with state", slog.Any("state", cmd.ProcessState), slog.Int("process", ap.Process.Pid))
}

a.agentCount--
Expand Down
3 changes: 3 additions & 0 deletions sdk/go/agent/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ func (a *Runner) performHeartbeat() {
}

func (a *Runner) Shutdown() error {
if a.micro == nil {
return nil
}
return a.micro.Stop()
}

Expand Down
Loading