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

INCR clears TTL #25

Closed
serandel opened this issue Feb 19, 2019 · 1 comment
Closed

INCR clears TTL #25

serandel opened this issue Feb 19, 2019 · 1 comment
Labels

Comments

@serandel
Copy link

From the Redis docs:

EXPIRE key seconds
Available since 1.0.0.

Time complexity: O(1)

Set a timeout on key. After the timeout has expired, the key will automatically be deleted. A key with an associated timeout is often said to be volatile in Redis terminology.

The timeout will only be cleared by commands that delete or overwrite the contents of the key, including DEL, SET, GETSET and all the *STORE commands. This means that all the operations that conceptually alter the value stored at the key without replacing it with a new one will leave the timeout untouched. For instance, incrementing the value of a key with INCR, pushing a new value into a list with LPUSH, or altering the field value of a hash with HSET are all operations that will leave the timeout untouched.

Nevertheless, my tests are failing...

        redis = RedisServer.newRedisServer();  // bind to a random port
        redis.start();
        jedis = new Jedis(redis.getHost(), redis.getBindPort());
        jedis.set(REDIS_KEY, "1");
        jedis.expire(REDIS_KEY, REMAINING_TTL);
        assertEquals(REMAINING_TTL, jedis.ttl(REDIS_KEY)); // OK
        jedis.incr(REDIS_KEY);
        assertEquals(REMAINING_TTL, jedis.ttl(REDIS_KEY)); // Got -1

Am I misunderstanding something?

@fppt fppt added the bug label Feb 19, 2019
@fppt
Copy link
Owner

fppt commented Feb 19, 2019

Hmmm let me look into this. Might be a bug in the library.

@fppt fppt closed this as completed in c00fdf7 Oct 28, 2019
fppt pushed a commit that referenced this issue Dec 21, 2021
* Refactor expiring key value storage (#2)


Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* Refactor operation factory (#4)

* refactor operation factory

* wait-notify for waiting operations

* update reflections, eager static initialization of CommandFactory

Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* remove debug output

* guava deleted (#5)

* guava deleted

Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* add dependabot (#6)

* remove Publish Test Report

it does not work well with dependabot's PRs

* Bump mockito-core from 3.10.0 to 4.0.0 (#15)

Bumps [mockito-core](https://github.com/mockito/mockito) from 3.10.0 to 4.0.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v3.10.0...v4.0.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump slf4j-api from 1.7.20 to 1.7.32 (#12)

Bumps [slf4j-api](https://github.com/qos-ch/slf4j) from 1.7.20 to 1.7.32.
- [Release notes](https://github.com/qos-ch/slf4j/releases)
- [Commits](qos-ch/slf4j@v_1.7.20...v_1.7.32)

---
updated-dependencies:
- dependency-name: org.slf4j:slf4j-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump junit-jupiter from 5.5.2 to 5.8.1 (#9)

Bumps [junit-jupiter](https://github.com/junit-team/junit5) from 5.5.2 to 5.8.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.5.2...r5.8.1)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump maven-source-plugin from 2.2.1 to 3.2.1 (#14)

Bumps [maven-source-plugin](https://github.com/apache/maven-source-plugin) from 2.2.1 to 3.2.1.
- [Release notes](https://github.com/apache/maven-source-plugin/releases)
- [Commits](apache/maven-source-plugin@maven-source-plugin-2.2.1...maven-source-plugin-3.2.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-source-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump maven-javadoc-plugin from 2.9.1 to 3.3.1 (#13)

Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 2.9.1 to 3.3.1.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](apache/maven-javadoc-plugin@maven-javadoc-plugin-2.9.1...maven-javadoc-plugin-3.3.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump maven-compiler-plugin from 3.1 to 3.8.1 (#10)

Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.1 to 3.8.1.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](apache/maven-compiler-plugin@maven-compiler-plugin-3.1...maven-compiler-plugin-3.8.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump checkstyle from 8.42 to 9.1 (#11)

Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 8.42 to 9.1.
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](checkstyle/checkstyle@checkstyle-8.42...checkstyle-9.1)

---
updated-dependencies:
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump maven-gpg-plugin from 1.5 to 3.0.1 (#16)

Bumps [maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 1.5 to 3.0.1.
- [Release notes](https://github.com/apache/maven-gpg-plugin/releases)
- [Commits](apache/maven-gpg-plugin@maven-gpg-plugin-1.5...maven-gpg-plugin-3.0.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-gpg-plugin
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump maven-pmd-plugin from 3.7 to 3.15.0 (#8)

Bumps [maven-pmd-plugin](https://github.com/apache/maven-pmd-plugin) from 3.7 to 3.15.0.
- [Release notes](https://github.com/apache/maven-pmd-plugin/releases)
- [Commits](apache/maven-pmd-plugin@maven-pmd-plugin-3.7...maven-pmd-plugin-3.15.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-pmd-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump lettuce-core from 6.1.1.RELEASE to 6.1.5.RELEASE (#18)

Bumps [lettuce-core](https://github.com/lettuce-io/lettuce-core) from 6.1.1.RELEASE to 6.1.5.RELEASE.
- [Release notes](https://github.com/lettuce-io/lettuce-core/releases)
- [Changelog](https://github.com/lettuce-io/lettuce-core/blob/6.1.5.RELEASE/RELEASE-NOTES.md)
- [Commits](redis/lettuce@6.1.1.RELEASE...6.1.5.RELEASE)

---
updated-dependencies:
- dependency-name: io.lettuce:lettuce-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump jedis from 3.6.0 to 3.7.0 (#17)

Bumps [jedis](https://github.com/redis/jedis) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/redis/jedis/releases)
- [Commits](redis/jedis@jedis-3.6.0...v3.7.0)

---
updated-dependencies:
- dependency-name: redis.clients:jedis
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump spotbugs version (#19)

* fix pubsub (#20)

* fix pubsub

* Remove slice serialization functions (#21)


* Store RMSet directly for pf and s operations

* Use RMList directly instead of Slice in l-operations

* Use RMHMap instead of Slice for z operations

* Remove not needed (de)serialisation code. Clean related imports

* Move some type-related logic from Expiring Key-Value store

* Remove wildcard import to match checkstyle

* Remove serializable interface from Slice

* Add polimorfic getTypeName to RMDataStructure children

Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* Bump maven-release-plugin from 2.5 to 2.5.3 (#22)

Bumps maven-release-plugin from 2.5 to 2.5.3.

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-release-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Supported operations generator (#23)

* Add markdown generator of supported operations

* Add generated list

* Update link to generated list

* Add GitHub Actions step to update supported operations list

Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* use git-auto-commit action

* fix Test annotation

* Update list of supported operations

* add LINE_SEPARATOR

* Update list of supported operations

* set linebreaks

* Update list of supported operations

* Bump mockito-core from 4.0.0 to 4.1.0 (#24)

Bumps [mockito-core](https://github.com/mockito/mockito) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.0.0...v4.1.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* update redis container version (#27)

* Update list of supported operations

* Organize operations (#28)

* Move operations to packages

* Add operation categories

* Update structure of supported operations list

* Update list of supported operations

* add persist support (#53) (#31)

* add persist support

* rebase, move class & fix test

Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* Bump checkstyle from 9.1 to 9.2 (#30)

Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 9.1 to 9.2.
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](checkstyle/checkstyle@checkstyle-9.1...checkstyle-9.2)

---
updated-dependencies:
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump junit-jupiter from 5.8.1 to 5.8.2 (#29)

Bumps [junit-jupiter](https://github.com/junit-team/junit5) from 5.8.1 to 5.8.2.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.8.1...r5.8.2)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update list of supported operations

* Bump spotbugs-maven-plugin from 4.4.2.2 to 4.5.0.0 (#25)

* Bump spotbugs-maven-plugin from 4.4.2.2 to 4.5.0.0

Bumps [spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.4.2.2 to 4.5.0.0.
- [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases)
- [Commits](spotbugs/spotbugs-maven-plugin@spotbugs-maven-plugin-4.4.2.2...spotbugs-maven-plugin-4.5.0.0)

---
updated-dependencies:
- dependency-name: com.github.spotbugs:spotbugs-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* make spotbugs happy

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* Update list of supported operations

* Organize tests (#33)

* Move tests to packages

* Remove ANSI escape code from output

Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* Update list of supported operations

* Mocked operations handler (#32)

* Added handler field and new constructors to classes.

* MockExecutor & RedisCommandInterceptor interface.

* refactor and update README.md

Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* Watch unwatch (#34)

* watch/unwatch commands added

* unwatch added to discard

Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* Update list of supported operations

* Add psubscribe, punsubscribe commands, pubSumNumPat subcommand (#35)

* Add psubscribe, punsubscribe commands, pubSumNumPat subcommand

Co-authored-by: Ivan Ponomarev <iponomarev@mail.ru>

* Update list of supported operations

* Bump jedis from 3.7.0 to 3.7.1 (#36)

Bumps [jedis](https://github.com/redis/jedis) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/redis/jedis/releases)
- [Commits](redis/jedis@v3.7.0...v3.7.1)

---
updated-dependencies:
- dependency-name: redis.clients:jedis
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mockito-core from 4.1.0 to 4.2.0 (#37)

Bumps [mockito-core](https://github.com/mockito/mockito) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](mockito/mockito@v4.1.0...v4.2.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* extra test based on #155 report

* Update README.md

Co-authored-by: Egor Zyazev <klever.kl@yandex.ru>
Co-authored-by: Julia Stepanova <yuliya.stepanova@phystech.edu>
Co-authored-by: Aleksandr Muratidi <60786024+aleksandr1101@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: inponomarev <inponomarev@users.noreply.github.com>
Co-authored-by: Georgy Guminov <43472625+gogagum@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants