hard exit when services fail

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2023-09-19 14:25:22 +02:00
parent 2d3133b8a5
commit 1f1aa50c54
33 changed files with 48 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -60,6 +60,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -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"
@@ -59,6 +60,7 @@ func Server(cfg *config.Config) *cli.Command {
Err(err).
Msg("Shutting down server")
cancel()
os.Exit(1)
})
{

View File

@@ -74,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -56,6 +56,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -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"
@@ -100,6 +101,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -65,6 +65,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -60,6 +60,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
@@ -68,6 +69,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -74,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -95,6 +95,7 @@ func Server(cfg *config.Config) *cli.Command {
Err(err).
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -95,6 +95,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
@@ -88,6 +89,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"fmt"
"os"
"github.com/oklog/run"
@@ -113,6 +114,7 @@ func Server(cfg *config.Config) *cli.Command {
natsServer.Shutdown()
cancel()
os.Exit(1)
})
return gr.Run()

View File

@@ -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"
@@ -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(

View File

@@ -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"
@@ -81,6 +82,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -86,6 +86,7 @@ func Server(cfg *config.Config) *cli.Command {
Err(err).
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"net/http"
"os"
"time"
"github.com/go-chi/chi/v5"
@@ -154,6 +155,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
@@ -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.
@@ -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.

View File

@@ -74,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -61,6 +61,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -63,6 +63,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"
"github.com/oklog/run"
@@ -75,6 +76,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
@@ -73,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
server, err := debug.Server(

View File

@@ -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"
@@ -144,6 +145,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -74,6 +74,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
debugServer, err := debug.Server(

View File

@@ -93,6 +93,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
@@ -83,6 +84,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}

View File

@@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"
"github.com/oklog/run"
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
@@ -96,6 +97,7 @@ func Server(cfg *config.Config) *cli.Command {
Msg("Shutting down server")
cancel()
os.Exit(1)
})
}