You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/05/09 20:51:00 UTC

[jira] [Commented] (GEODE-5198) NPE in DataSerializer registration when forming a client/server connection during handshake

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

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

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

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.


> 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
>             Fix For: 1.7.0
>
>         Attachments: DataSerializerHolderJUnitTest.java
>
>
> 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)