Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-15616

Redis Plugin: UNLOCK needs to UNWATCH WATCHed key

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.2.0
    • Fix Version/s: 6.2.0
    • Component/s: Plugins
    • Labels:
      None

      Description

      UNLOCK uses the redis WATCH command to detect changes on a key to determine whether a transaction, in this case, deletion of the locked key, should proceed. i.e.

      WATCH(key)
      GET(key)
      if (isLocked(key))
      { 
         MULTI()
         DELETE(key)
         EXEC()
      }
      

      Here the EXEC will clear the WATCHed state of 'key', however, this is not true if isLocked(key) is FALSE or if an exception occurs after the WATCH and before the EXEC such that the cached connection being used is reused with the said key still in it's WATCHed state.

      This issue addresses the first case whilst the latter, of exceptions, is addressed by HPCC-15710 (see below).

      Since UNWATCH only returns an "OK" as a REDIS_REPLY_STATUS and doesn't contain information that this "OK" is in response to the UNWATCH, there is no way to guarantee a successful UNWATCH when having encountered an exception. For this reason, the correct solution is to simply close the connection. Such exception handling is true of all exceptions using pipelined commands which is true of all plugin functions as the AUTH and SELECT commands are pipelined upon opening a new connection. This is implemented by HPCC-15710

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jamienoss Jamie Noss
                Reporter:
                jamienoss Jamie Noss
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: