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

fix(server): fix getex command with persist can get time overflow #707

Merged

Conversation

boazsade
Copy link
Contributor

Signed-off-by: Boaz Sade [email protected]

This fix issue #705
GETEX command with PERSIST will result in integer overflow since in this case, the expiration time cannot be calculated.
The fix is, in case we have persist enable, don't try to calculate the persist time, just set as persist value.

@boazsade boazsade requested a review from romange January 19, 2023 09:51
@boazsade boazsade force-pushed the getex-with-persist-invalid-time-calc branch from 7480d34 to 99b84ef Compare January 19, 2023 09:52
@dranikpg
Copy link
Contributor

Interestingly, I found the same issue today and fixed it, but not as well structured as with your solution 🙂

https://github.com/dragonflydb/dragonfly/pull/699/files#diff-883d71d37722157c22061e0b592d4784172d9e6f50a8cbf0c76f349e483418e6

dranikpg
dranikpg previously approved these changes Jan 19, 2023
src/server/db_slice.cc Outdated Show resolved Hide resolved
src/server/db_slice.cc Outdated Show resolved Hide resolved
Copy link
Collaborator

@romange romange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@romange
Copy link
Collaborator

romange commented Jan 19, 2023 via email

@boazsade boazsade force-pushed the getex-with-persist-invalid-time-calc branch from 99b84ef to 671b451 Compare January 19, 2023 13:57
@boazsade boazsade requested a review from romange January 19, 2023 13:59
src/server/generic_family.cc Outdated Show resolved Hide resolved
src/server/generic_family.cc Outdated Show resolved Hide resolved
src/server/string_family.cc Outdated Show resolved Hide resolved
@boazsade boazsade force-pushed the getex-with-persist-invalid-time-calc branch from 671b451 to 5284ec2 Compare January 19, 2023 15:58
@boazsade boazsade merged commit 5af6ee9 into dragonflydb:main Jan 19, 2023
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

Successfully merging this pull request may close these issues.

3 participants