Skip to content

Commit

Permalink
hard exit when services fail
Browse files Browse the repository at this point in the history
Signed-off-by: jkoberg <jkoberg@owncloud.com>
  • Loading branch information
kobergj committed Sep 19, 2023
1 parent 7c9ce23 commit 6587e59
Show file tree
Hide file tree
Showing 33 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions services/app-provider/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/app-registry/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
2 changes: 2 additions & 0 deletions services/audit/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/cs3org/reva/v2/pkg/events"
"github.com/cs3org/reva/v2/pkg/events/stream"
Expand Down Expand Up @@ -59,6 +60,7 @@ func Server(cfg *config.Config) *cli.Command {
Err(err).
Msg("Shutting down server")
cancel()
os.Exit(1)
})

{
Expand Down
1 change: 1 addition & 0 deletions services/auth-basic/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/auth-bearer/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/auth-machine/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/auth-service/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
2 changes: 2 additions & 0 deletions services/clientlog/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/cs3org/reva/v2/pkg/events"
"github.com/cs3org/reva/v2/pkg/events/stream"
Expand Down Expand Up @@ -100,6 +101,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
11 changes: 11 additions & 0 deletions services/frontend/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down Expand Up @@ -97,6 +98,16 @@ func Server(cfg *config.Config) *cli.Command {
cancel()
})

if true {
logger.Error().
Err(err).
Str("server", cfg.Service.Name).
Msg("Shutting down server")

cancel()
os.Exit(1)
}

return gr.Run()
},
}
Expand Down
1 change: 1 addition & 0 deletions services/gateway/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
2 changes: 2 additions & 0 deletions services/graph/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
Expand Down Expand Up @@ -68,6 +69,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
1 change: 1 addition & 0 deletions services/groups/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/idm/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func Server(cfg *config.Config) *cli.Command {
Err(err).
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

Expand Down
1 change: 1 addition & 0 deletions services/idp/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
2 changes: 2 additions & 0 deletions services/invitations/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
Expand Down Expand Up @@ -88,6 +89,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
2 changes: 2 additions & 0 deletions services/nats/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"fmt"
"os"

"github.com/oklog/run"

Expand Down Expand Up @@ -113,6 +114,7 @@ func Server(cfg *config.Config) *cli.Command {

natsServer.Shutdown()
cancel()
os.Exit(1)
})

return gr.Run()
Expand Down
2 changes: 2 additions & 0 deletions services/ocdav/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/cs3org/reva/v2/pkg/micro/ocdav"
"github.com/cs3org/reva/v2/pkg/sharedconf"
Expand Down Expand Up @@ -99,6 +100,7 @@ func Server(cfg *config.Config) *cli.Command {
Str("server", c.Command.Name).
Msg("Shutting down server")
cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
2 changes: 2 additions & 0 deletions services/ocs/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
"github.com/owncloud/ocis/v2/ocis-pkg/version"
Expand Down Expand Up @@ -81,6 +82,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
1 change: 1 addition & 0 deletions services/postprocessing/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func Server(cfg *config.Config) *cli.Command {
Err(err).
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

Expand Down
2 changes: 2 additions & 0 deletions services/proxy/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"net/http"
"os"
"time"

"github.com/go-chi/chi/v5"
Expand Down Expand Up @@ -154,6 +155,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
3 changes: 3 additions & 0 deletions services/settings/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
Expand Down Expand Up @@ -75,6 +76,7 @@ func Server(cfg *config.Config) *cli.Command {
servers.Add(httpServer.Run, func(_ error) {
logger.Info().Str("server", "http").Msg("Shutting down server")
cancel()
os.Exit(1)
})

// prepare a gRPC server and add it to the group run.
Expand All @@ -90,6 +92,7 @@ func Server(cfg *config.Config) *cli.Command {
servers.Add(grpcServer.Run, func(_ error) {
logger.Info().Str("server", "grpc").Msg("Shutting down server")
cancel()
os.Exit(1)
})

// prepare a debug server and add it to the group run.
Expand Down
1 change: 1 addition & 0 deletions services/sharing/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/storage-publiclink/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/storage-shares/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/storage-system/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/storage-users/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
2 changes: 2 additions & 0 deletions services/store/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"

Expand Down Expand Up @@ -75,6 +76,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
2 changes: 2 additions & 0 deletions services/thumbnails/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
Expand Down Expand Up @@ -73,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

server, err := debug.Server(
Expand Down
2 changes: 2 additions & 0 deletions services/userlog/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/cs3org/reva/v2/pkg/events"
"github.com/cs3org/reva/v2/pkg/events/stream"
Expand Down Expand Up @@ -144,6 +145,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
1 change: 1 addition & 0 deletions services/users/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})

debugServer, err := debug.Server(
Expand Down
1 change: 1 addition & 0 deletions services/web/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
2 changes: 2 additions & 0 deletions services/webdav/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
Expand Down Expand Up @@ -83,6 +84,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")

cancel()
os.Exit(1)
})
}

Expand Down
Loading

0 comments on commit 6587e59

Please sign in to comment.