MapExecuteOnKeyRequest should reference requester's threadId #5857

Closed
LoneRifle opened this Issue Aug 4, 2015 · 0 comments

Projects

None yet

2 participants

@LoneRifle
Contributor

ClientMapProxy and MapProxyImpl differ slightly in behaviour for the following methods:

  • executeOnKey
  • submitToKey (2 overloads)

In MapProxyImpl, these create an EntryOperation with the threadId set. This does not happen with ClientMapProxy. MapExecuteOnKeyRequest should hence take a threadId and set this on the generated EntryOperation.

This matters when a process explicitly locks a key in a distributed map, and then proceeds to invoke executeOnKey or submitToKey. This will work without issue for full members for the reasons described above, but may not work for clients.

@gurbuzali gurbuzali added this to the 3.6 milestone Aug 4, 2015
@LoneRifle LoneRifle added a commit to LoneRifle/hazelcast that referenced this issue Aug 7, 2015
@LoneRifle LoneRifle * Add threadId as a long to MapExecuteOnKeyRequest, which should tag …
…the request as the id of the current thread, typically from ThreadUtils.getThreadId. Similarly, add threadId to the client protocol MapCodecTemplate methods relating to executeOnKey and submitToKey.

* Set threadId in the EntryOperation returned by MapExecuteOnKeyRequest.prepareOperation, MapSubmitToKeyRequest.prepareOperation and MapExecuteOnKeyMessageTask.prepareOperation.

* Supply threadId in ClientMapProxy when creating such requests.

Fixes #5857
551e3fa
@LoneRifle LoneRifle added a commit to LoneRifle/hazelcast that referenced this issue Aug 7, 2015
@LoneRifle LoneRifle Fix #5857: Add threadId to MapExecuteOnKeyRequest
* Add threadId as a long to MapExecuteOnKeyRequest, which should tag the
request as the id of the current thread, typically from
ThreadUtils.getThreadId. Similarly, add threadId to the client protocol
MapCodecTemplate methods relating to executeOnKey and submitToKey.

* Set threadId in the EntryOperation returned by
MapExecuteOnKeyRequest.prepareOperation,
MapSubmitToKeyRequest.prepareOperation and
MapExecuteOnKeyMessageTask.prepareOperation.

* Supply threadId in ClientMapProxy when creating such requests.

Fixes #5857
3182bba
@asimarslan asimarslan closed this in #5883 Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment