Skip to content

Commit

Permalink
Return CACHE_RECONNECT if memcached returned a fatal result code
Browse files Browse the repository at this point in the history
  • Loading branch information
ndptech committed Dec 18, 2024
1 parent 1e7602d commit db18476
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static cache_status_t cache_entry_find(rlm_cache_entry_t **out,
RERROR("Failed retrieving entry: %s: %s", memcached_strerror(mandle->handle, mret),
memcached_last_error_message(mandle->handle));

return CACHE_ERROR;
return memcached_fatal(mret) ? CACHE_RECONNECT : CACHE_ERROR;
}
RDEBUG2("Retrieved %zu bytes from memcached", len);
RDEBUG2("%s", from_store);
Expand Down Expand Up @@ -239,7 +239,7 @@ static cache_status_t cache_entry_insert(UNUSED rlm_cache_config_t const *config
RERROR("Failed storing entry: %s: %s", memcached_strerror(mandle->handle, ret),
memcached_last_error_message(mandle->handle));

return CACHE_ERROR;
return memcached_fatal(ret) ? CACHE_RECONNECT : CACHE_ERROR;
}

return CACHE_OK;
Expand All @@ -266,7 +266,7 @@ static cache_status_t cache_entry_expire(UNUSED rlm_cache_config_t const *config

default:
RERROR("Failed deleting entry: %s", memcached_last_error_message(mandle->handle));
return CACHE_ERROR;
return memcached_fatal(ret) ? CACHE_RECONNECT : CACHE_ERROR;
}
}

Expand Down

0 comments on commit db18476

Please sign in to comment.