geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (GEODE-3021) OQL Index isIndexedPdxKeys potential concurrency issue
Date Fri, 09 Jun 2017 18:41:22 GMT


ASF GitHub Bot commented on GEODE-3021:

Github user kirklund commented on a diff in the pull request:
    --- Diff: geode-core/src/main/java/org/apache/geode/cache/query/internal/index/
    @@ -2002,7 +2002,8 @@ void populateListForEquiJoin(List list, Object outerEntries, Object
       synchronized void setPdxStringFlag(Object key) {
         // For Null and Undefined keys do not set the isIndexedPdxKeysFlagSet flag
    -    if (key == null || key == IndexManager.NULL || key == QueryService.UNDEFINED) {
    +    if (isIndexedPdxKeysFlagSet || key == null || key == IndexManager.NULL
    --- End diff --
    Looks like you have two flags for the same thing... isIndexedPdxKeys and isIndexedPdxKeysFlagSet?

> OQL Index isIndexedPdxKeys potential concurrency issue
> ------------------------------------------------------
>                 Key: GEODE-3021
>                 URL:
>             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

View raw message