diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2025-12-13 12:10:15 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-13 12:10:15 -0800 |
| commit | d80d8be01208ffe82861b8aa50d4baf599fdfa02 (patch) | |
| tree | fa6cf7c55579356d4a73514c71e0ec167eb44c47 /weed/s3api/s3api_server.go | |
| parent | 36b8b2147b55068f65f6c4cacc5645bc3453f173 (diff) | |
| download | seaweedfs-d80d8be01208ffe82861b8aa50d4baf599fdfa02.tar.xz seaweedfs-d80d8be01208ffe82861b8aa50d4baf599fdfa02.zip | |
fix(s3): start KeepConnectedToMaster for filer discovery with filerGroup (#7732)
Fixes #7721
When S3 server is configured with a filerGroup, it creates a MasterClient
to enable dynamic filer discovery. However, the KeepConnectedToMaster()
background goroutine was never started, causing GetMaster() to block
indefinitely in WaitUntilConnected().
This resulted in the log message:
WaitUntilConnected still waiting for master connection (attempt N)...
being logged repeatedly every ~20 seconds.
The fix adds the missing 'go masterClient.KeepConnectedToMaster(ctx)'
call to properly establish the connection to master servers.
Also adds unit tests to verify WaitUntilConnected respects context
cancellation.
Diffstat (limited to 'weed/s3api/s3api_server.go')
| -rw-r--r-- | weed/s3api/s3api_server.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/s3api/s3api_server.go b/weed/s3api/s3api_server.go index 94321814e..4a8368409 100644 --- a/weed/s3api/s3api_server.go +++ b/weed/s3api/s3api_server.go @@ -115,6 +115,8 @@ func NewS3ApiServerWithStore(router *mux.Router, option *S3ApiServerOption, expl masterMap[fmt.Sprintf("master%d", i)] = addr } masterClient := wdclient.NewMasterClient(option.GrpcDialOption, option.FilerGroup, cluster.S3Type, "", "", "", *pb.NewServiceDiscoveryFromMap(masterMap)) + // Start the master client connection loop - required for GetMaster() to work + go masterClient.KeepConnectedToMaster(context.Background()) filerClient = wdclient.NewFilerClient(option.Filers, option.GrpcDialOption, option.DataCenter, &wdclient.FilerClientOption{ MasterClient: masterClient, |
