Fixes the segmentation fault error in watcher

Signed-off-by: Tao He <sighingnow@gmail.com>
This commit is contained in:
Tao He 2023-03-14 20:26:39 +08:00
parent d27f0b9e81
commit 1ae7df959c
2 changed files with 0 additions and 5 deletions

View File

@ -187,7 +187,6 @@ void etcdv3::AsyncLeaseKeepAliveAction::CancelKeepAlive()
<< context.debug_error_string() << std::endl; << context.debug_error_string() << std::endl;
} }
grpc::Status status;
stream->Finish(&status, (void *)KEEPALIVE_FINISH); stream->Finish(&status, (void *)KEEPALIVE_FINISH);
if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *)KEEPALIVE_FINISH) { if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *)KEEPALIVE_FINISH) {
// ok // ok

View File

@ -69,7 +69,6 @@ void etcdv3::AsyncWatchAction::waitForResponse()
} }
if(got_tag == (void*)etcdv3::WATCH_WRITES_DONE) if(got_tag == (void*)etcdv3::WATCH_WRITES_DONE)
{ {
grpc::Status status;
stream->Finish(&status, (void *)etcdv3::WATCH_FINISH); stream->Finish(&status, (void *)etcdv3::WATCH_FINISH);
continue; continue;
} }
@ -84,7 +83,6 @@ void etcdv3::AsyncWatchAction::waitForResponse()
// cancel on-the-fly calls, but don't shutdown the completion queue as there // cancel on-the-fly calls, but don't shutdown the completion queue as there
// are still a inflight call to finish // are still a inflight call to finish
context.TryCancel(); context.TryCancel();
// cq_.Shutdown();
continue; continue;
} }
@ -150,7 +148,6 @@ void etcdv3::AsyncWatchAction::waitForResponse(std::function<void(etcd::Response
} }
if(got_tag == (void*)etcdv3::WATCH_WRITES_DONE) if(got_tag == (void*)etcdv3::WATCH_WRITES_DONE)
{ {
grpc::Status status;
stream->Finish(&status, (void *)etcdv3::WATCH_FINISH); stream->Finish(&status, (void *)etcdv3::WATCH_FINISH);
continue; continue;
} }
@ -171,7 +168,6 @@ void etcdv3::AsyncWatchAction::waitForResponse(std::function<void(etcd::Response
// cancel on-the-fly calls, but don't shutdown the completion queue as there // cancel on-the-fly calls, but don't shutdown the completion queue as there
// are still a inflight call to finish // are still a inflight call to finish
context.TryCancel(); context.TryCancel();
// cq_.Shutdown();
continue; continue;
} }