mirror of
https://github.com/pgsty/minio.git
synced 2026-07-23 14:10:25 +03:00
fix: use its own lock in serverConfigV17 (#4014)
Previously serverConfigV17 used a global lock that made any instance of serverConfigV17 depended on single global serverConfigMu. This patch fixes by having individual lock per instances.
This commit is contained in:
+4
-10
@@ -104,17 +104,9 @@ func newGatewayConfig(accessKey, secretKey, region string) error {
|
||||
SecretKey: secretKey,
|
||||
})
|
||||
|
||||
// Set default printing to console.
|
||||
srvCfg.Logger.SetConsole(NewConsoleLogger())
|
||||
|
||||
// Set custom region.
|
||||
srvCfg.SetRegion(region)
|
||||
|
||||
// Create certs path for SSL configuration.
|
||||
if err := createConfigDir(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// hold the mutex lock before a new config is assigned.
|
||||
// Save the new config globally.
|
||||
// unlock the mutex.
|
||||
@@ -139,8 +131,7 @@ func gatewayMain(ctx *cli.Context) {
|
||||
// TODO: add support for custom region when we add
|
||||
// support for S3 backend storage, currently this can
|
||||
// default to "us-east-1"
|
||||
err := newGatewayConfig(accessKey, secretKey, "us-east-1")
|
||||
fatalIf(err, "Unable to initialize gateway config")
|
||||
newGatewayConfig(accessKey, secretKey, globalMinioDefaultRegion)
|
||||
|
||||
// Get quiet flag from command line argument.
|
||||
quietFlag := ctx.Bool("quiet") || ctx.GlobalBool("quiet")
|
||||
@@ -151,6 +142,9 @@ func gatewayMain(ctx *cli.Context) {
|
||||
// First argument is selected backend type.
|
||||
backendType := ctx.Args().First()
|
||||
|
||||
// Create certs path for SSL configuration.
|
||||
fatalIf(createConfigDir(), "Unable to create configuration directory")
|
||||
|
||||
newObject, err := newGatewayLayer(backendType, accessKey, secretKey)
|
||||
fatalIf(err, "Unable to initialize gateway layer")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user