mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
Delay the cancellation of ctx when stopping the node (#28247)
Signed-off-by: SimFG <bang.fu@zilliz.com>
This commit is contained in:
parent
64f6dbabdc
commit
e3b7fdac61
@ -396,10 +396,11 @@ func (node *DataNode) ReadyToFlush() error {
|
||||
// Stop will release DataNode resources and shutdown datanode
|
||||
func (node *DataNode) Stop() error {
|
||||
node.stopOnce.Do(func() {
|
||||
node.cancel()
|
||||
// https://github.com/milvus-io/milvus/issues/12282
|
||||
node.UpdateStateCode(commonpb.StateCode_Abnormal)
|
||||
node.flowgraphManager.close()
|
||||
// Delay the cancellation of ctx to ensure that the session is automatically recycled after closed the flow graph
|
||||
node.cancel()
|
||||
|
||||
node.eventManagerMap.Range(func(_ string, m *channelEventManager) bool {
|
||||
m.Close()
|
||||
|
@ -453,13 +453,14 @@ func (node *QueryNode) Stop() error {
|
||||
|
||||
node.UpdateStateCode(commonpb.StateCode_Abnormal)
|
||||
node.lifetime.Wait()
|
||||
node.cancel()
|
||||
if node.scheduler != nil {
|
||||
node.scheduler.Stop()
|
||||
}
|
||||
if node.pipelineManager != nil {
|
||||
node.pipelineManager.Close()
|
||||
}
|
||||
// Delay the cancellation of ctx to ensure that the session is automatically recycled after closed the pipeline
|
||||
node.cancel()
|
||||
if node.session != nil {
|
||||
node.session.Stop()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user