diff options
author | dormando <dormando@rydia.net> | 2023-04-17 18:06:49 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2023-04-17 18:06:49 -0700 |
commit | 294e0d9fe6922642655504bec4d1845f6603a03c (patch) | |
tree | e52e3d4dbdb10ca2de59cbb61dfd63423bf36e79 | |
parent | 4e310166bc1f633430f18f05ff4ac62f40124f31 (diff) | |
download | memcached-294e0d9fe6922642655504bec4d1845f6603a03c.tar.gz |
proxy: fix memory accounting underflow
the previous fix broke memory accounting by underflowing the counter
after an OOM. This broke the final test in t/proxyconfig.t sometimes
intermittently.
-rw-r--r-- | proxy_network.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/proxy_network.c b/proxy_network.c index 316775e..a764187 100644 --- a/proxy_network.c +++ b/proxy_network.c @@ -517,6 +517,8 @@ static int proxy_backend_drive_machine(mcp_backend_t *be) { if (oom) { flags = P_BE_FAIL_OOM; + // need to zero out blen so we don't over-decrement later + r->blen = 0; stop = true; break; } @@ -529,6 +531,7 @@ static int proxy_backend_drive_machine(mcp_backend_t *be) { pthread_mutex_unlock(&r->thread->proxy_limit_lock); flags = P_BE_FAIL_OOM; + r->blen = 0; stop = true; break; } |