diff --git a/src/v3/AsyncWatchAction.cpp b/src/v3/AsyncWatchAction.cpp index 249137f..ef630de 100644 --- a/src/v3/AsyncWatchAction.cpp +++ b/src/v3/AsyncWatchAction.cpp @@ -85,23 +85,10 @@ void etcdv3::AsyncWatchAction::waitForResponse() isCancelled.store(true); stream->WritesDone((void*)etcdv3::WATCH_WRITES_DONE); - if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *)etcdv3::WATCH_WRITES_DONE) { - // ok - } else { - std::cerr << "WARN: Failed to mark a watch connection as DONE" << std::endl; - } grpc::Status status; stream->Finish(&status, (void *)this); - // n.b., don't wait, as there might be another extra "Read" action on the fly. - // - // if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *)this) { - // // ok - // } else { - // std::cerr << "WARN: Failed to finish a watch connection" << std::endl; - // } - cq_.Shutdown(); // leave a warning if the response is too large and been fragmented @@ -123,25 +110,10 @@ void etcdv3::AsyncWatchAction::CancelWatch() { std::lock_guard scope_lock(this->protect_is_cancalled); if (!isCancelled.exchange(true)) { - void* got_tag; - bool ok = false; - stream->WritesDone((void*)etcdv3::WATCH_WRITES_DONE); - if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *)etcdv3::WATCH_WRITES_DONE) { - // ok - } else { - std::cerr << "WARN: Failed to mark a watch connection as DONE" << std::endl; - } grpc::Status status; stream->Finish(&status, (void *)this); - // n.b., don't wait, as there might be another extra "Read" action on the fly. - // - // if (cq_.Next(&got_tag, &ok) && ok && got_tag == (void *)this) { - // // ok - // } else { - // std::cerr << "WARN: Failed to finish a watch connection" << std::endl; - // } cq_.Shutdown(); }