MB-19732: Only update sendTime if successfully send noop 24/64724/8
authorDaniel Owen <owend@couchbase.com>
Thu, 21 Apr 2016 09:51:48 +0000 (10:51 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 7 Jun 2016 15:14:31 +0000 (15:14 +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/64724
Well-Formed: buildbot <build@couchbase.com>
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
src/dcp-producer.cc

index 71fa895..a19a4d5 100644 (file)
@@ -718,10 +718,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;
         }
     }