mirror of
https://github.com/versity/versitygw.git
synced 2026-09-20 06:54:47 +00:00
feat: add concurrency limiter to scoutfs
This brings scoutfs in-line with the posix concurrency limiter. This fixes a hang with scoutfs due to not correctly initializing the concurrency in posix leading to a concurrency of 0 allowed. This also adds a sane default to the posix concurrency when not initialized.
This commit is contained in:
@@ -99,6 +99,13 @@ move interfaces as well as support for tiered filesystems.`,
|
||||
EnvVars: []string{"VGW_DISABLE_NOARCHIVE"},
|
||||
Destination: &disableNoArchive,
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "concurrency",
|
||||
Usage: "maximum concurrent actions allowed",
|
||||
EnvVars: []string{"VGW_POSIX_CONCURRENCY"},
|
||||
Value: 5000,
|
||||
Destination: &actionsConcurrency,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -112,6 +119,10 @@ func runScoutfs(ctx *cli.Context) error {
|
||||
return fmt.Errorf("invalid directory permissions: %d", dirPerms)
|
||||
}
|
||||
|
||||
if actionsConcurrency <= 0 {
|
||||
return fmt.Errorf("concurrency must be positive, got %d", actionsConcurrency)
|
||||
}
|
||||
|
||||
var opts scoutfs.ScoutfsOpts
|
||||
opts.GlacierMode = glacier
|
||||
opts.ChownUID = chownuid
|
||||
@@ -122,6 +133,7 @@ func runScoutfs(ctx *cli.Context) error {
|
||||
opts.VersioningDir = versioningDir
|
||||
opts.ValidateBucketNames = disableStrictBucketNames
|
||||
opts.SetProjectID = setProjectID
|
||||
opts.Concurrency = actionsConcurrency
|
||||
|
||||
be, err := scoutfs.New(ctx.Args().Get(0), opts)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user