-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer fixes #223
base: dev
Are you sure you want to change the base?
Buffer fixes #223
Conversation
|
||
if(redis.Query(std::vector<std::string>{"EXPIRE", key, std::to_string(expiry)}, result, true) != REDIS_REPLY_INTEGER) { | ||
DARWIN_LOG_ERROR("AConnector::REDISSetExpiry:: not the expected Redis response"); | ||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implicit cast, this should return false
_is_stop = true; | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the logic is mostly hte same, I don't understand the need for a change in this method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the change is in the position of the this->_cv.wait_for()
While we immediately started the task before, now it waits one iteration of _interval before launching it
DARWIN_LOG_INFO("SumConnector:: REDISPopLogs:: key '" + sum_name + "' does not exist (yet?)"); | ||
return false; | ||
DARWIN_LOG_DEBUG("SumConnector:: REDISPopLogs:: key '" + sum_name + "' did not exist"); | ||
result = std::string("0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This modification seems to be done to resolve an issue that I don't know nor can identify the issue, I can't review it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Redis returns a NIL, it means that the key does not exist
For our use, the key might not exist yet, so this is not an invalid read (so we mustn't return false)
However, I can't remember why I casted the value to std::string("0") here, but I will improve the code
@@ -163,7 +162,7 @@ long long int SumConnector::REDISListLen(const std::string &sum_name) noexcept { | |||
} | |||
else { | |||
DARWIN_LOG_ERROR("SumConnector::REDISListLen:: Error while querying key '" + sum_name + "'"); | |||
result = 0.0L; | |||
return -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This modification seems to be done to resolve an issue that I don't know nor can identify the issue, I can't review it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the previous return didn't specify an error in the process, now it does (and is checked in BufferThread.cpp:34)
f5246e1
to
af58aa4
Compare
automatically set an expiration time (interval time + 60 seconds) to each cache key this avoids changing a buffer filter's configuration and having keys left unused on Redis
…ring return on REDISSetExpiry
✨ Buffer fixes and improvements
📃 Type of change
Please delete options that are not relevant.
Bug fix: non-breaking change which fixes an issue.
💡 Related Issue(s)
✒️ Description
Fixed
Added
🎯 Test Environments
Ubuntu (18.04)
✔️ Checklist: