Better race condition prevention

This commit is contained in:
Dane Everitt
2020-04-10 18:22:18 -07:00
parent 17d204a631
commit 03045c94be
9 changed files with 99 additions and 81 deletions

View File

@@ -134,7 +134,7 @@ func rootCmdRun(*cobra.Command, []string) {
//
// This will also validate that a server process is running if the last tracked state we have
// is that it was running, but we see that the container process is not currently running.
if r || (!r && (s.State == server.ProcessRunningState || s.State == server.ProcessStartingState)) {
if r || (!r && s.IsRunning()) {
zap.S().Infow("detected server is running, re-attaching to process", zap.String("server", s.Uuid))
if err := s.Environment.Start(); err != nil {
zap.S().Warnw(