Fixes the segmentation fault error in watcher (#206)
Signed-off-by: Tao He <sighingnow@gmail.com>
This commit is contained in:
parent
f0f9c4e8c2
commit
5e27ac33c6
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue