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

MapExecuteOnKeyRequest should reference requester's threadId #5857

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

Comments

Projects
None yet
2 participants
@LoneRifle
Copy link
Contributor

commented Aug 4, 2015

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 added a commit to LoneRifle/hazelcast that referenced this issue Aug 7, 2015

* 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 hazelcast#5857

LoneRifle added a commit to LoneRifle/hazelcast that referenced this issue Aug 7, 2015

Fix hazelcast#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 hazelcast#5857

asimarslan added a commit that referenced this issue Aug 13, 2015

Merge pull request #5883 from LoneRifle/patch-5883
Fix #5857: Add threadId to MapExecuteOnKeyRequest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.