mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Redis: Fix thread-contention issues with Expire(), add more tests
This commit is contained in:
parent
b81e876ec8
commit
cca1d4f988
7 changed files with 200 additions and 40 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
|
||||
#include "zeek/iosource/IOSource.h"
|
||||
#include "zeek/storage/Backend.h"
|
||||
|
||||
|
@ -75,11 +77,7 @@ public:
|
|||
void HandlePutResult(redisReply* reply, OperationResultCallback* callback);
|
||||
void HandleGetResult(redisReply* reply, OperationResultCallback* callback);
|
||||
void HandleEraseResult(redisReply* reply, OperationResultCallback* callback);
|
||||
void HandleZRANGEBYSCORE(redisReply* reply);
|
||||
|
||||
// HandleGeneric exists so that async-running-as-sync operations can remove
|
||||
// themselves from the list of active operations.
|
||||
void HandleGeneric() { --active_ops; }
|
||||
void HandleGeneric(redisReply* reply);
|
||||
|
||||
protected:
|
||||
void Poll() override;
|
||||
|
@ -95,6 +93,7 @@ private:
|
|||
std::deque<redisReply*> reply_queue;
|
||||
|
||||
OpenResultCallback* open_cb;
|
||||
std::mutex expire_mutex;
|
||||
|
||||
std::string server_addr;
|
||||
std::string key_prefix;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue