From 1ae7df959c1d59a09a6b970a31a08ca6710dee0f Mon Sep 17 00:00:00 2001 From: Tao He Date: Tue, 14 Mar 2023 20:26:39 +0800 Subject: [PATCH] Fixes the segmentation fault error in watcher Signed-off-by: Tao He --- src/v3/AsyncLeaseAction.cpp | 1 - src/v3/AsyncWatchAction.cpp | 4 ---- 2 files changed, 5 deletions(-) diff --git a/src/v3/AsyncLeaseAction.cpp b/src/v3/AsyncLeaseAction.cpp index 984d911..76f51e6 100644 --- a/src/v3/AsyncLeaseAction.cpp +++ b/src/v3/AsyncLeaseAction.cpp @@ -187,7 +187,6 @@ void etcdv3::AsyncLeaseKeepAliveAction::CancelKeepAlive() << context.debug_error_string() << std::endl; } - grpc::Status status; stream->Finish(&status, (void *)KEEPALIVE_FINISH); if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *)KEEPALIVE_FINISH) { // ok diff --git a/src/v3/AsyncWatchAction.cpp b/src/v3/AsyncWatchAction.cpp index b4f5d7c..505f4f2 100644 --- a/src/v3/AsyncWatchAction.cpp +++ b/src/v3/AsyncWatchAction.cpp @@ -69,7 +69,6 @@ void etcdv3::AsyncWatchAction::waitForResponse() } if(got_tag == (void*)etcdv3::WATCH_WRITES_DONE) { - grpc::Status status; stream->Finish(&status, (void *)etcdv3::WATCH_FINISH); continue; } @@ -84,7 +83,6 @@ void etcdv3::AsyncWatchAction::waitForResponse() // cancel on-the-fly calls, but don't shutdown the completion queue as there // are still a inflight call to finish context.TryCancel(); - // cq_.Shutdown(); continue; } @@ -150,7 +148,6 @@ void etcdv3::AsyncWatchAction::waitForResponse(std::functionFinish(&status, (void *)etcdv3::WATCH_FINISH); continue; } @@ -171,7 +168,6 @@ void etcdv3::AsyncWatchAction::waitForResponse(std::function