MB-19897: Only update sendTime if successfully send noop 78/64878/4
authorDaniel Owen <owend@couchbase.com>
Thu, 21 Apr 2016 09:51:48 +0000 (10:51 +0100)
committerDave Rigby <daver@couchbase.com>
Mon, 13 Jun 2016 10:09:50 +0000 (10:09 +0000)
In the maybeSendNoop function when a DCP producer attempts
to send a noop to a consumer it can receive back
ENGINE_SUCCESS or ENGINE_E2BIG.

We should only set pendingRecv to true and update the
last sendTime if ENGINE_SUCCESS is returned.

Change-Id: Ice8a66dcae35505d7bab7d261f080d5ffb95c8e3
Reviewed-on: http://review.couchbase.org/64878
Well-Formed: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/dcp-producer.cc

index 1a07e1a..9f7afc2 100644 (file)
@@ -774,10 +774,10 @@ ENGINE_ERROR_CODE DcpProducer::maybeSendNoop(struct dcp_message_producers* produ
 
             if (ret == ENGINE_SUCCESS) {
                 ret = ENGINE_WANT_MORE;
+                noopCtx.pendingRecv = true;
+                noopCtx.sendTime = ep_current_time();
+                lastSendTime = ep_current_time();
             }
-            noopCtx.pendingRecv = true;
-            noopCtx.sendTime = ep_current_time();
-            lastSendTime = ep_current_time();
             return ret;
         }
     }