mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-14 10:08:35 +02:00
make LockClient persistent on S3ApiServer
Avoid per-request allocation by initializing the lock client once at server startup. The gRPC connections were already pooled; this eliminates the remaining struct allocation overhead.
This commit is contained in:
1 parent
0f5c6a8ae0
commit
98fcda66f2
2 files changed
+3
-2
No files matched your search
@@ -82,6 +82,7 @@ type S3ApiServer struct {
|
||||
embeddedIam *EmbeddedIamApi // Embedded IAM API server (when enabled)
|
||||
stsHandlers *STSHandlers // STS HTTP handlers for AssumeRoleWithWebIdentity
|
||||
cipher bool // encrypt data on volume servers
|
||||
lockClient *cluster.LockClient
|
||||
}
|
||||
|
||||
func NewS3ApiServer(router *mux.Router, option *S3ApiServerOption) (s3ApiServer *S3ApiServer, err error) {
|
||||
@@ -180,6 +181,7 @@ func NewS3ApiServerWithStore(router *mux.Router, option *S3ApiServerOption, expl
|
||||
policyEngine: policyEngine, // Initialize bucket policy engine
|
||||
inFlightDataLimitCond: sync.NewCond(new(sync.Mutex)),
|
||||
cipher: option.Cipher,
|
||||
lockClient: cluster.NewLockClient(option.GrpcDialOption, option.Filers[0]),
|
||||
}
|
||||
|
||||
// Set s3a reference in circuit breaker for upload limiting
|
||||
|
||||
Reference in new issue
Block a user