libmemcached icon indicating copy to clipboard operation
libmemcached copied to clipboard

Does not seem to read your write.

Open MaoZiming opened this issue 1 year ago • 1 comments

I have some code structured in this way:

memcached_return_t set_result;
set_result = memcached_set(memc, request->key().c_str(), request->key().size(), db_value.c_str(), db_value.size(), (time_t)ttl_, (uint32_t)0);
assert(set_result == MEMCACHED_SUCCESS);
memcached_return_t get_result;
char *value = memcached_get(memc, request->key().c_str(), request->key().size(), &value_length, &flags, &get_result);
assert(value != NULL);

The second assert is triggered, even though memcached_set has succeeded. Just wondering what could be a possible reason for that. Thanks

MaoZiming avatar Sep 02 '24 22:09 MaoZiming

Wrong TTL or choice of connection options or a bug? It's impossible to guess anything based on this little code example.

m6w6 avatar Aug 28 '25 12:08 m6w6