Skip to content

Commit

Permalink
curvefs/client: memcache client set nullptr after operation fail
Browse files Browse the repository at this point in the history
Signed-off-by: ilixiaocui <ilixiaocui@163.com>
  • Loading branch information
ilixiaocui authored and opencurveadmin committed Mar 24, 2023
1 parent d42e78f commit c9a8f47
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions curvefs/src/client/kvclient/memcache_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ class MemCachedClient : public KVClient {
return true;
}
*errorlog = ResError(res);
memcached_free(tcli);
tcli = nullptr;
LOG(ERROR) << "Set key = " << key << " error = " << *errorlog;
return false;
}
Expand All @@ -144,9 +146,11 @@ class MemCachedClient : public KVClient {

*errorlog = ResError(ue);
if (ue != MEMCACHED_NOTFOUND) {
LOG(ERROR) << "Get key = " << key << " error = " << *errorlog
<< ", get_value_len = " << value_length
<< ", expect_value_len = " << length;
LOG(ERROR) << "Get key = " << key << " error = " << *errorlog
<< ", get_value_len = " << value_length
<< ", expect_value_len = " << length;
memcached_free(tcli);
tcli = nullptr;
}

return false;
Expand Down

0 comments on commit c9a8f47

Please sign in to comment.