Uploaded image for project: 'Spymemcached Java Client'
  1. Spymemcached Java Client
  2. SPY-69

CASMutator expiration doesn't work properly.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.3
    • Fix Version/s: 2.8.0
    • Component/s: library
    • Security Level: Public
    • Labels:
      None
    • Environment:
      All

      Description

      Team, got a customer saying that the CAS operation within spy 2.7.3 doesn't seem to reset the expiration of a key properly.

      Here's a snippet of code:

      public String updateVsSession(String key, final String session) throws Exception {

      MemcachedClient sessionClient = cachePool.getConnection(PersistableBeanType.VS_SESSION);

      Transcoder tc = new SerializingTranscoder();

      CASMutator<String> mutator = new CASMutator<String>(sessionClient, tc);

      CASMutation<String> mutation = new CASMutation<String>() {

      public String getNewValue(String current)

      { return session; }

      };

      return mutator.cas(key, session, 1900, mutation);

      }

      It appears that when running the CAS operation only once, the key expires as expected. However, if an update is made and the operation is run again, the key seems to last forever.

      Can you confirm whether this is a bug or expected? The customer expects that the CAS operation would constantly "extend" the expiration time.

      # Subject Project Status CR V
      For Gerrit Dashboard: &For+SPY-69=message:SPY-69

        Activity

        Hide
        mikew Mike Wiederhold added a comment -

        From bug fix commit message:

        The cas call in this class wasn't using the function that allows
        the expiration to be specified. As a result, if the CASMutator was
        used and an item was already in memcached then the expiration would
        be set to 0.

        Show
        mikew Mike Wiederhold added a comment - From bug fix commit message: The cas call in this class wasn't using the function that allows the expiration to be specified. As a result, if the CASMutator was used and an item was already in memcached then the expiration would be set to 0.
        Hide
        perry Perry Krug added a comment -

        If this is fixed, can we mark it as resolved?

        Show
        perry Perry Krug added a comment - If this is fixed, can we mark it as resolved?

          People

          • Assignee:
            mikew Mike Wiederhold
            Reporter:
            mikew Mike Wiederhold
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes