[
https://issues.apache.org/jira/browse/GEODE-3021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16039300#comment-16039300
]
ASF GitHub Bot commented on GEODE-3021:
---------------------------------------
GitHub user jhuynh1 opened a pull request:
https://github.com/apache/geode/pull/565
GEODE-3021: Any call after the first to setPdxStringFlag should no-op
* The flag isIndexedPdxKeysFlagSet is now checked before setting pdx
string flag
@nabarunnag @ladyVader
Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [X] Is there a JIRA ticket associated with this PR? Is it referenced in
the commit message?
- [X] Has your PR been rebased against the latest commit within the target
branch (typically `develop`)?
- [X] Is your initial contribution a single, squashed commit?
- [X] Does `gradlew build` run cleanly?
- [X] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
### Note:
Please ensure that once the PR is submitted, you check travis-ci for build
issues and
submit an update to your PR as soon as possible. If you need help, please
send an
email to [email protected].
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/geode feature/GEODE-3021
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/geode/pull/565.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #565
----
commit c2943a4acb9c9325662a4cbee14823e0a1c05061
Author: Jason Huynh <[email protected]>
Date: 2017-06-01T20:52:41Z
GEODE-3021: Any call after the first to setPdxStringFlag should no-op
* The flag isIndexedPdxKeysFlagSet is now checked before setting pdx
string flag
----
> OQL Index isIndexedPdxKeys potential concurrency issue
> ------------------------------------------------------
>
> Key: GEODE-3021
> URL: https://issues.apache.org/jira/browse/GEODE-3021
> Project: Geode
> Issue Type: Bug
> Components: querying
> Reporter: Jason Huynh
> Assignee: Jason Huynh
>
> The boolean isIndexedPdxKeys is set in a synchronized method. However
> multiple threads could be making a call to this method, the last caller would
> set the flag based on it's key, either true or false, but the previous
> callers could have meant to set it to the opposite.
> This method sets isIndexedPdxKeysFlagSet afterwards and hopes that callers to
> this method check this flag first. However, again, multiple threads could
> have checked this flag, seen it as false, and then all attempted to call the
> synchronized method.
> The solution is to probably check the isIndexedPdxKeysFlagSet flag in the
> method also. That way, if another thread had already completed
> setPdxStringFlag(), the next call would be a no-op.
> The current issue will lead to possible class cast exceptions from String to
> PdxString or vice versa
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)