Skip to content
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

Inconsistent EXPIRE: EXPIRE with big integer overflows when converted to milliseconds #672

Open
lucifercr07 opened this issue Sep 20, 2024 · 10 comments
Assignees

Comments

@lucifercr07
Copy link
Contributor

lucifercr07 commented Sep 20, 2024

Steps to reproduce

Run the commands mentioned in the test on Line 110 in the file https://github.com/AshwinKul28/dice-tests/blob/main/tcltests/unit/expire.tcl#L110.

Expected output

The expected output when the above set of commands when run on Redis

Expected an error matching 'ERR invalid expire time in 'expire' command' but got '1' (context: type eval line 5 cmd {assert_error "ERR invalid expire time in 'expire' command" {r EXPIRE foo 9223370399119966}} proc ::test)

Observed output

The observed output when the above set of commands when run on DiceDB

Expected an error matching 'ERR invalid expire time in 'expire' command' but got '1' (context: type eval line 5 cmd {assert_error "ERR invalid expire time in 'expire' command" {r EXPIRE foo 9223370399119966}} proc ::test)

The steps to run the test cases are mentioned in the README of the dice-tests repository.

Expectations for resolution

This issue will be considered resolved when the following things are done:

  1. Changes in the dice repository code to meet the expected behavior.
  2. Successful run of the tcl test behavior.

You can find the tests under the tests directory of the dice repository and the steps to run are in the README file. Refer to the following links to set up DiceDB and Redis 7.2.5 locally

@Abh-ay
Copy link
Contributor

Abh-ay commented Sep 20, 2024

@lucifercr07 of
please assign me this one also as i will cover in issue #671

Thanks!!

@AshwinKul28
Copy link
Contributor

@Abh-ay Thanks for picking this up. Assigned

@Abh-ay
Copy link
Contributor

Abh-ay commented Sep 22, 2024

Hi @AshwinKul28 @lucifercr07
we are getting unexpected output due to assert_error "ERR invalid expire time in 'expire' command" {r EXPIRE foo 9223370399119966}
and we set max value for expiry is 9223372036854775 in dice-db
and for this command redis behaviour put below
image
So should we need to ignore it or change value in dice-test?

@AshwinKul28
Copy link
Contributor

AshwinKul28 commented Sep 22, 2024

@Abh-ay This was changed recently. Ideally, if we are not setting up an expiry time and returning 1 is not good behavior I feel.

So we have two options, keep it consistent as per our behaviour or make it consistent with redis.

To make sure it is consistent with the redis, we can ignore if the value is greater than 9223372036854775 and return 1 as a response but actually, it doesn't set the value. (I feel this is misguided)

what do you think? @lucifercr07

@Abh-ay
Copy link
Contributor

Abh-ay commented Sep 22, 2024

Yes @AshwinKul28 bit confused behaviour of redis,
for now I think we are running properly for this expire value.
If we are getting expire value greater than 9223372036854775 then return an error and getting smaller then we return 1.
If we keep it consistent as per our behaviour then we have to make changes in dice-test.
@lucifercr07 Should i raise PR for dice-test repo or need to change in dice for handling this cases.

@AshwinKul28
Copy link
Contributor

You can raise a PR in the dice-repo, link this issue there. we will review it. Thanks @Abh-ay

@Abh-ay
Copy link
Contributor

Abh-ay commented Sep 29, 2024

Hi @AshwinKul28 @lucifercr07
Please have a look into this PR.
AshwinKul28/dice-tests#10

@arpitbbhayani
Copy link
Contributor

Hello @Abh-ay,

There has been no activity on this issue for the past 5 days.
It would be awesome if you keep posting updates to this issue so that we know you are actively working on it.

We are really eager to close this issue at the earliest, hence if we continue to see the inactivity, we will have to reassign the issue to someone else. We are doing this to ensure that the project maintains its momentum and others are not blocked on this work.

Just drop a comment with the current status of the work or share any issues you are facing. We can always chip in to help you out.

Thanks again.

@Abh-ay
Copy link
Contributor

Abh-ay commented Oct 9, 2024

Hi @arpitbbhayani
for now I think we are running properly for this expire value.
If we are getting expire value greater than 9223372036854775 then return an error and if provided value is smaller then we return 1 as a success response.
And for that I already raised PR for dice-test in which I modified testcase you can visit AshwinKul28/dice-tests#10
@AshwinKul28 @lucifercr07
Can you please review this PR and update?

@arpitbbhayani
Copy link
Contributor

Hello @Abh-ay,

There has been no activity on this issue for the past 5 days.
It would be awesome if you keep posting updates to this issue so that we know you are actively working on it.

We are really eager to close this issue at the earliest, hence if we continue to see the inactivity, we will have to reassign the issue to someone else. We are doing this to ensure that the project maintains its momentum and others are not blocked on this work.

Just drop a comment with the current status of the work or share any issues you are facing. We can always chip in to help you out.

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants