Skip to content

Commit

Permalink
Merge remote-tracking branch 'couchbase/unstable' into HEAD
Browse files Browse the repository at this point in the history
http: //ci-eventing.northscale.in/eventing-16.02.2021-10.31.pass.html
Change-Id: Ib51ca9fc246cb0c612bbe0462573f1ac6649b185
  • Loading branch information
jeelanp2003 committed Feb 16, 2021
2 parents 7658e2a + 1f06902 commit 0bbd9d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 8 additions & 0 deletions features/src/bucket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ Bucket::Get(const std::string &key) {
const auto max_timeout = UnwrapData(isolate_)->op_timeout;
auto [err_code, result] =
RetryLcbCommand(connection_, *cmd, max_retry, max_timeout, LcbGet);
lcb_cmdget_destroy(cmd);
if (err_code != LCB_SUCCESS) {
++lcb_retry_failure;
return {nullptr, std::make_unique<lcb_STATUS>(err_code), nullptr};
Expand Down Expand Up @@ -245,6 +246,7 @@ Bucket::GetWithMeta(const std::string &key) {
const auto max_timeout = UnwrapData(isolate_)->op_timeout;
auto [err_code, result] =
RetryLcbCommand(connection_, *cmd, max_retry, max_timeout, LcbSubdocSet);
lcb_cmdsubdoc_destroy(cmd);
lcb_subdocspecs_destroy(specs);
if (err_code != LCB_SUCCESS) {
++lcb_retry_failure;
Expand Down Expand Up @@ -285,6 +287,7 @@ Bucket::CounterWithoutXattr(const std::string &key, uint64_t cas,
const auto max_timeout = UnwrapData(isolate_)->op_timeout;
auto [err_code, result] =
RetryLcbCommand(connection_, *cmd, max_retry, max_timeout, LcbSubdocSet);
lcb_cmdsubdoc_destroy(cmd);
lcb_subdocspecs_destroy(spec);
if (err_code != LCB_SUCCESS) {
++lcb_retry_failure;
Expand Down Expand Up @@ -345,6 +348,7 @@ Bucket::CounterWithXattr(const std::string &key, uint64_t cas, lcb_U32 expiry,
const auto max_timeout = UnwrapData(isolate_)->op_timeout;
auto [err_code, result] =
RetryLcbCommand(connection_, *cmd, max_retry, max_timeout, LcbSubdocSet);
lcb_cmdsubdoc_destroy(cmd);
lcb_subdocspecs_destroy(specs);
if (err_code != LCB_SUCCESS) {
++lcb_retry_failure;
Expand Down Expand Up @@ -407,6 +411,7 @@ Bucket::SetWithXattr(const std::string &key, const std::string &value,
const auto max_timeout = UnwrapData(isolate_)->op_timeout;
auto [err_code, result] =
RetryLcbCommand(connection_, *cmd, max_retry, max_timeout, LcbSubdocSet);
lcb_cmdsubdoc_destroy(cmd);
lcb_subdocspecs_destroy(specs);
if (err_code != LCB_SUCCESS) {
++lcb_retry_failure;
Expand Down Expand Up @@ -442,6 +447,7 @@ Bucket::SetWithoutXattr(const std::string &key, const std::string &value,
const auto max_timeout = UnwrapData(isolate_)->op_timeout;
auto [err_code, result] =
RetryLcbCommand(connection_, *cmd, max_retry, max_timeout, LcbSet);
lcb_cmdstore_destroy(cmd);
if (err_code != LCB_SUCCESS) {
++lcb_retry_failure;
return {nullptr, std::make_unique<lcb_STATUS>(err_code), nullptr};
Expand Down Expand Up @@ -501,6 +507,7 @@ Bucket::DeleteWithXattr(const std::string &key, uint64_t cas) {
const auto max_timeout = UnwrapData(isolate_)->op_timeout;
auto [err_code, result] = RetryLcbCommand(connection_, *cmd, max_retry,
max_timeout, LcbSubdocDelete);
lcb_cmdsubdoc_destroy(cmd);
lcb_subdocspecs_destroy(specs);
if (err_code != LCB_SUCCESS) {
++lcb_retry_failure;
Expand Down Expand Up @@ -532,6 +539,7 @@ Bucket::DeleteWithoutXattr(const std::string &key, uint64_t cas) {
const auto max_timeout = UnwrapData(isolate_)->op_timeout;
auto [err_code, result] =
RetryLcbCommand(connection_, *cmd, max_retry, max_timeout, LcbDelete);
lcb_cmdremove_destroy(cmd);
if (err_code != LCB_SUCCESS) {
++lcb_retry_failure;
return {nullptr, std::make_unique<lcb_STATUS>(err_code), nullptr};
Expand Down
6 changes: 0 additions & 6 deletions features/src/lcb_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ std::pair<lcb_STATUS, Result> LcbGet(lcb_INSTANCE *instance, lcb_CMDGET &cmd) {
return {err, result};
}

lcb_cmdget_destroy(&cmd);
err = lcb_wait(instance, LCB_WAIT_DEFAULT);

if (err != LCB_SUCCESS) {
Expand All @@ -266,7 +265,6 @@ std::pair<lcb_STATUS, Result> LcbSet(lcb_INSTANCE *instance,
return {err, result};
}

lcb_cmdstore_destroy(&cmd);
err = lcb_wait(instance, LCB_WAIT_DEFAULT);

if (err != LCB_SUCCESS) {
Expand All @@ -286,7 +284,6 @@ std::pair<lcb_STATUS, Result> LcbDelete(lcb_INSTANCE *instance,
return {err, result};
}

lcb_cmdremove_destroy(&cmd);
err = lcb_wait(instance, LCB_WAIT_DEFAULT);

if (err != LCB_SUCCESS) {
Expand All @@ -306,7 +303,6 @@ std::pair<lcb_STATUS, Result> LcbSubdocSet(lcb_INSTANCE *instance,
return {err, result};
}

lcb_cmdsubdoc_destroy(&cmd);
err = lcb_wait(instance, LCB_WAIT_DEFAULT);

if (err != LCB_SUCCESS) {
Expand All @@ -326,7 +322,6 @@ std::pair<lcb_STATUS, Result> LcbSubdocDelete(lcb_INSTANCE *instance,
return {err, result};
}

lcb_cmdsubdoc_destroy(&cmd);
err = lcb_wait(instance, LCB_WAIT_DEFAULT);

if (err != LCB_SUCCESS) {
Expand All @@ -346,7 +341,6 @@ std::pair<lcb_STATUS, Result> LcbGetCounter(lcb_INSTANCE *instance,
return {err, result};
}

lcb_cmdcounter_destroy(&cmd);
err = lcb_wait(instance, LCB_WAIT_DEFAULT);

if (err != LCB_SUCCESS) {
Expand Down

0 comments on commit 0bbd9d2

Please sign in to comment.