mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-28 05:15:00 +08:00
LocalPartition shutdown
This commit is contained in:
parent
ab9fc0ad70
commit
e3c8be7f89
@ -182,26 +182,26 @@ func (p *LocalPartition) MaybeConnectToFollowers(initMessage *mq_pb.PublishMessa
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *LocalPartition) MaybeShutdownLocalPartition() (hasShutdown bool) {
|
func (p *LocalPartition) MaybeShutdownLocalPartition() (hasShutdown bool) {
|
||||||
if !p.Publishers.IsEmpty() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if !p.Subscribers.IsEmpty() {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
p.LogBuffer.ShutdownLogBuffer()
|
|
||||||
|
|
||||||
if p.followerStream != nil {
|
if p.Publishers.IsEmpty() {
|
||||||
// send close to the follower
|
if p.followerStream != nil {
|
||||||
if followErr := p.followerStream.Send(&mq_pb.PublishFollowMeRequest{
|
// send close to the follower
|
||||||
Message: &mq_pb.PublishFollowMeRequest_Close{
|
if followErr := p.followerStream.Send(&mq_pb.PublishFollowMeRequest{
|
||||||
Close: &mq_pb.PublishFollowMeRequest_CloseMessage{},
|
Message: &mq_pb.PublishFollowMeRequest_Close{
|
||||||
},
|
Close: &mq_pb.PublishFollowMeRequest_CloseMessage{},
|
||||||
}); followErr != nil {
|
},
|
||||||
glog.Errorf("Error closing follower stream: %v", followErr)
|
}); followErr != nil {
|
||||||
|
glog.Errorf("Error closing follower stream: %v", followErr)
|
||||||
|
}
|
||||||
|
glog.V(4).Infof("closing grpcConnection to follower")
|
||||||
|
p.followerGrpcConnection.Close()
|
||||||
|
p.followerStream = nil
|
||||||
}
|
}
|
||||||
glog.V(4).Infof("closing grpcConnection to follower")
|
}
|
||||||
p.followerGrpcConnection.Close()
|
|
||||||
p.followerStream = nil
|
if p.Publishers.IsEmpty() && p.Subscribers.IsEmpty() {
|
||||||
|
p.LogBuffer.ShutdownLogBuffer()
|
||||||
|
hasShutdown = true
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user