You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behaviour:
run "string_family_test " under "build-dbg" , the test "GetEx" will report "db_slice.cc:592:42: runtime error: signed integer overflow: -9223372036854775808 * 1000 cannot be represented in type 'long int'" (you would not see this in optimised build because this is undefined when the code is optimised).
OR, in redis-cli
set foo bar
getex foo PERSIST
See error "/db_slice.cc:592:42: runtime error: signed integer overflow: -9223372036854775808 * 1000 cannot be represented in type 'long int'" in console.
Expected behavior
This should not happen, since it indicating that we're trying to calculate invalid time for the expiration.
Please note that this happen as a result of the function ":ExpireParams::Calculate" in db_slice.cc that is normalised the time value to ms by multiplying by 1000, but the input value in this case is INT64_MIN, a value that cannot be multiple to make it smaller (as its already the smallest it can be).
Environment (please complete the following information):
OS: ubuntu 22.04
Kernel: Linux dfly2 5.15.0-57-generic 63-Ubuntu SMP Thu Nov 24 13:43:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Containerized?: Bare Metal
Dragonfly Version: 0.13.0
Reproducible Code Snippet
The test GetEx under string_family_test.cc
The text was updated successfully, but these errors were encountered:
This fix is to not check expiration value in case PERSIST is set. In this case, just set the value for expiration to 0, which means don't expire this value.
So when the user with run the command "GETEX foo PERSIST" it will not try to calculate the expiration time, since there is none. We will just update the value (if found), to not have expiration time, which means, it never expire.
This will also make the code a little simpler, since before that, we would check whether persist is enabled, and now, this is done at a single location.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behaviour:
Expected behavior
This should not happen, since it indicating that we're trying to calculate invalid time for the expiration.
Please note that this happen as a result of the function ":ExpireParams::Calculate" in db_slice.cc that is normalised the time value to ms by multiplying by 1000, but the input value in this case is INT64_MIN, a value that cannot be multiple to make it smaller (as its already the smallest it can be).
Environment (please complete the following information):
Reproducible Code Snippet
The test GetEx under string_family_test.cc
The text was updated successfully, but these errors were encountered: