Fixes the segmentation fault error in watcher (#206)

Signed-off-by: Tao He <sighingnow@gmail.com>
This commit is contained in:
Tao He 2023-03-14 20:36:53 +08:00 committed by GitHub
parent f0f9c4e8c2
commit 5e27ac33c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
} }