phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Steenkamp (JIRA)" <>
Subject [jira] [Created] (PHOENIX-4860) CursorUtil Needs to Use a ConcurrentHashMap rather than HashMap
Date Tue, 21 Aug 2018 15:48:00 GMT
Jack Steenkamp created PHOENIX-4860:

             Summary: CursorUtil Needs to Use a ConcurrentHashMap rather than HashMap
                 Key: PHOENIX-4860
             Project: Phoenix
          Issue Type: Bug
    Affects Versions: 5.0.0, 4.13.1, 4.14.0
            Reporter: Jack Steenkamp
         Attachments: CursorUtil.patch

in very rare cases, when dealing with Apache Phoenix Cursors, the following NullPointerException
is encountered:

java.lang.NullPointerException: null
at org.apache.phoenix.util.CursorUtil.updateCursor(

(This is for 4.13.1 - but seems that
org.apache.phoenix.util.CursorUtil has not changed, at the time of writing, since first being
introduced as part of PHOENIX-3572).

Upon closer inspection it would seem that on line 124 of CursorUtil, a
HashMap is used to keep state which is then exposed via a number of
static methods, which, one has to assume, can be accessed by many
different threads. Using a plain old HashMap in cases like these can cause issues.

The mapCursorIDQuery member should be a ConcurrentHashMap instead? That should tighten up
the class and prevent any potential inconsistencies.

This message was sent by Atlassian JIRA

View raw message