diff --git a/src/v3/AsyncWatchAction.cpp b/src/v3/AsyncWatchAction.cpp index f4e2ae5..8b1b9cd 100644 --- a/src/v3/AsyncWatchAction.cpp +++ b/src/v3/AsyncWatchAction.cpp @@ -63,7 +63,11 @@ void etcdv3::AsyncWatchAction::waitForResponse() } if(got_tag == (void*)this) // read tag { - if ((reply.created() && reply.header().revision() < parameters.revision) || + if (reply.canceled()) { + isCancelled = true; + cq_.Shutdown(); + } + else if ((reply.created() && reply.header().revision() < parameters.revision) || reply.events_size() > 0) { // we stop watch under two conditions: // @@ -125,6 +129,15 @@ void etcdv3::AsyncWatchAction::waitForResponse(std::function