diff options
author | Ramasai <ramasai.tadepalli+3108@gmail.com> | 2023-02-22 19:31:17 -0500 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2023-03-08 10:45:31 -0800 |
commit | 894974de30f6d7155b384dbdf417fa08c1497b1a (patch) | |
tree | 4417138f3b9970a752bb14d94d42b9988b374591 | |
parent | 95a82aa84d59a9208902bcb08594807280742ed8 (diff) | |
download | memcached-894974de30f6d7155b384dbdf417fa08c1497b1a.tar.gz |
log: fix race condition while incrementing log entries dropped
-rw-r--r-- | logger.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -971,8 +971,8 @@ enum logger_ret_type logger_log(logger *l, const enum log_entry_type event, cons /* Request a maximum length of data to write to */ e = (logentry *) bipbuf_request(buf, (sizeof(logentry) + reqlen)); if (e == NULL) { - pthread_mutex_unlock(&l->mutex); l->dropped++; + pthread_mutex_unlock(&l->mutex); return LOGGER_RET_NOSPACE; } e->event = event; |