[
https://issues.apache.org/jira/browse/GEODE-3315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16101018#comment-16101018
]
ASF GitHub Bot commented on GEODE-3315:
---------------------------------------
GitHub user upthewaterspout opened a pull request:
https://github.com/apache/geode/pull/658
GEODE-3315: Replaced PreferBytes... with VMCachedDeserializable
When getting a HAEventWrapper as part of a GII, make sure that we store
the wrapper in a VMCachedDeserializable. This object needs to have a
reference to the HAContainer. If PREFER_SERIALIZED is set to true, we
we using a PreferBytesSerializable which would always create new copy of
the HAEventWrapper.
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:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced in
the commit message?
- [ ] Has your PR been rebased against the latest commit within the target
branch (typically `develop`)?
- [ ] Is your initial contribution a single, squashed commit?
- [ ] Does `gradlew build` run cleanly?
- [ ] 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/upthewaterspout/incubator-geode
feature/GEODE-3315
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/geode/pull/658.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 #658
----
commit 68687f8f97bda1ba82ba1c192a6601b16ba7a67c
Author: Barry Oglesby <[email protected]>
Date: 2017-06-22T20:52:24Z
GEODE-3315: Replaced PreferBytes... with VMCachedDeserializable
When getting a HAEventWrapper as part of a GII, make sure that we store
the wrapper in a VMCachedDeserializable. This object needs to have a
reference to the HAContainer. If PREFER_SERIALIZED is set to true, we
we using a PreferBytesSerializable which would always create new copy of
the HAEventWrapper.
----
> NullPointerException creating a copy of a client queue when
> gemfire.PREFER_SERIALIZED=true
> ------------------------------------------------------------------------------------------
>
> Key: GEODE-3315
> URL: https://issues.apache.org/jira/browse/GEODE-3315
> Project: Geode
> Issue Type: Bug
> Components: client queues
> Reporter: Dan Smith
> Assignee: Dan Smith
>
> In the case of an HARegion, AbstractRegionMap.initialImagePut deserializes
> the value to set the haContainer. Normally, that value is a wrapped by a
> VMCachedDeserializable, and deserializing it replaces it in the
> VMCachedDeserializable. With -Dgemfire.PREFER_SERIALIZED=true, the value is
> wrapped by a PreferBytesCachedDeserializable and deserializing it creates a
> copy of the value. It doesn't replace it in the
> PreferBytesCachedDeserializable.
> So, in this case, the haContainer is being set on a copy of the value, not
> the value itself. It has no effect, and the value put into the HARegion has
> no haContainer.
> This is not really an issue until this member needs to provide an initial
> image for another member.
> At that time, a NullPointerException like this occurs:
> {noformat}
> [vm3] Caused by: java.lang.NullPointerException
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.cache.tier.sockets.HAEventWrapper.toData(HAEventWrapper.java:287)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.InternalDataSerializer.invokeToData(InternalDataSerializer.java:2299)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.InternalDataSerializer.writeDSFID(InternalDataSerializer.java:1406)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.InternalDataSerializer.basicWriteObject(InternalDataSerializer.java:2067)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.DataSerializer.writeObject(DataSerializer.java:2936)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.util.BlobHelper.serializeToBlob(BlobHelper.java:53)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.cache.EntryEventImpl.serialize(EntryEventImpl.java:1969)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.cache.EntryEventImpl.serialize(EntryEventImpl.java:1955)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.cache.PreferBytesCachedDeserializable.<init>(PreferBytesCachedDeserializable.java:69)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.cache.CachedDeserializableFactory.create(CachedDeserializableFactory.java:82)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.cache.AbstractRegionMap.initialImagePut(AbstractRegionMap.java:778)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.cache.InitialImageOperation.processChunk(InitialImageOperation.java:928)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.cache.InitialImageOperation$ImageProcessor.process(InitialImageOperation.java:1249)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.distributed.internal.ReplyMessage.process(ReplyMessage.java:213)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.internal.cache.InitialImageOperation$ImageReplyMessage.process(InitialImageOperation.java:2725)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.distributed.internal.ReplyMessage.dmProcess(ReplyMessage.java:193)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.distributed.internal.ReplyMessage.process(ReplyMessage.java:186)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.distributed.internal.DistributionMessage.scheduleAction(DistributionMessage.java:374)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.distributed.internal.DistributionMessage$1.run(DistributionMessage.java:440)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.distributed.internal.DistributionManager.runUntilShutdown(DistributionManager.java:665)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> org.apache.geode.distributed.internal.DistributionManager$5$1.run(DistributionManager.java:961)
> [vm3] at Remote Member '172.16.115.245(73551)<v3>:32772' in
> java.lang.Thread.run(Thread.java:748)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)