[ 
https://issues.apache.org/jira/browse/GEODE-5198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16472431#comment-16472431
 ] 

ASF subversion and git services commented on GEODE-5198:
--------------------------------------------------------

Commit a60b8d4237f0d27b9b31af304ae6ec3bfcdc077c in geode's branch 
refs/heads/feature/GEODE-5087 from [~bschuchardt]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=a60b8d4 ]

GEODE-5198 NPE in DataSerializer registration when forming a client/server 
connection during handshake

If a holder can't be found do not record supported classes for it.
Absense of the holder, which had just been inserted into the
idsToHolders collection, means that another thread has resolved the
holder into an actual DataSerializer class and has removed the holder
and its supported classes.

This closes #1943


> NPE in DataSerializer registration when forming a client/server connection 
> during handshake
> -------------------------------------------------------------------------------------------
>
>                 Key: GEODE-5198
>                 URL: https://issues.apache.org/jira/browse/GEODE-5198
>             Project: Geode
>          Issue Type: Improvement
>          Components: client/server, serialization
>            Reporter: Bruce Schuchardt
>            Assignee: Bruce Schuchardt
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.0
>
>         Attachments: DataSerializerHolderJUnitTest.java
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Someone hit an NPE when forming a connection to a server in an application 
> making heavy use of custom DataSerializers.  I wrote a unit test to reproduce 
> the problem (attached) which produces this:
> {noformat}
> java.lang.NullPointerException
>       at 
> java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
>       at 
> java.util.concurrent.ConcurrentHashMap.putIfAbsent(ConcurrentHashMap.java:1535)
>       at 
> org.apache.geode.internal.InternalDataSerializer.updateSupportedClassesMap(InternalDataSerializer.java:1079)
>       at 
> org.apache.geode.internal.DataSerializerHolderJUnitTest$1.run(DataSerializerHolderJUnitTest.java:72)
> {noformat}
> The problem is in the idsToHolders map in InternalDataSerializer. This map is 
> initialized with a "holder" object that knows the name and ID of a 
> DataSerializer. During tcp/ip connection formation one of these is created 
> when processing a list of DataSerializers sent to the client by the server as 
> part of the handshake. Then the server sends a map of the names of classes 
> supported by the serializers. It's in this second step that we're hitting the 
> NPE because some other thread has resolved the holder into an actual class 
> and has removed the holder from the idsToHolders map. This can be done in any 
> of three other methods in InternalDataSerializer that are used as a matter of 
> course in serializing/deserializing objects.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to