Uploaded image for project: 'Red Hat Data Grid'
  1. Red Hat Data Grid
  2. JDG-7265

[RESP] SET EX with big integer should throw an error

XMLWordPrintable

    • False
    • None
    • False

      Infinispan's response to SET with big integer expire time is OK whilst the key isn't stored and no error is thrown out. The same applies for GETEX with EX option.

      Infinispan:

      127.0.0.1:11222> set foo bar EX 10000000000000000
      OK
      127.0.0.1:11222> get foo
      (nil)
      127.0.0.1:11222> SET foo bar
      OK
      127.0.0.1:11222> GETEX foo EX 10000000000000000
      "bar"
      127.0.0.1:11222> get foo
      (nil)
      

      Redis:

      127.0.0.1:6379> set foo bar EX 10000000000000000
      (error) ERR invalid expire time in 'set' command
      127.0.0.1:6379> set foo bar
      OK
      127.0.0.1:6379> getex foo EX 10000000000000000
      (error) ERR invalid expire time in 'getex' command
      127.0.0.1:6379> get foo
      "bar"
      

      Another similar use cases with invalid expiration times:

      • GETEX with negative integer, which throws the error properly with SET key EX but doesn't on GETEX key EX.
        127.0.0.1:11222> SET key EX -9999999999999999
        (error) ERR Unknown argument for SET operation
        127.0.0.1:11222> set foo bar
        OK
        127.0.0.1:11222> getex foo EX -9999999999999999
        "bar"
        
      • EXPIRE
        127.0.0.1:11222> set foo bar
        OK
        127.0.0.1:11222> expire foo 9223370399119966
        (integer) 1
        127.0.0.1:11222> get foo
        (nil)
        

            Unassigned Unassigned
            rhn-support-pdrobek Pavel Drobek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: