Browse Source

filer may have trouble to re-connect

clientId is used twice: one for local metadata subscription, one for combined metadata subscription.
pull/3318/head
chrislu 3 years ago
parent
commit
fbd8f868a1
  1. 3
      weed/server/filer_grpc_server_sub_meta.go

3
weed/server/filer_grpc_server_sub_meta.go

@ -90,6 +90,9 @@ func (fs *FilerServer) SubscribeLocalMetadata(req *filer_pb.SubscribeMetadataReq
peerAddress := findClientAddress(stream.Context(), 0)
// use negative client id to differentiate from addClient()/deleteClient() used in SubscribeMetadata()
req.ClientId = -req.ClientId
alreadyKnown, clientName := fs.addClient(req.ClientName, peerAddress, req.ClientId)
if alreadyKnown {
return fmt.Errorf("duplicated local subscription detected for client %s id %d", clientName, req.ClientId)

Loading…
Cancel
Save