[
https://issues.apache.org/jira/browse/GEODE-7944?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17094684#comment-17094684
]
ASF GitHub Bot commented on GEODE-7944:
---------------------------------------
pivotal-jbarrett commented on a change in pull request #593:
URL: https://github.com/apache/geode-native/pull/593#discussion_r416771316
##########
File path: cppcache/src/QueueConnectionRequest.cpp
##########
@@ -28,10 +28,10 @@ void QueueConnectionRequest::toData(DataOutput& output)
const {
output.writeString(m_serverGp);
output.write(static_cast<int8_t>(DSCode::FixedIDByte));
output.write(static_cast<int8_t>(DSCode::ClientProxyMembershipId));
- uint32_t buffLen = 0;
- output.writeBytes(reinterpret_cast<uint8_t*>(const_cast<char*>(
- m_membershipID.getDSMemberId(buffLen))),
- buffLen);
+ uint32_t memIdBufferLength = 0;
+ auto memIdBuffer = m_membershipID.getDSMemberId(memIdBufferLength);
Review comment:
> The reason why I was reserved in changing getDSMemberId is because it
is used on two more places in native client when serializing membershipID.
Almost always a good rule of thumb but this code has lots of debt. You see
from this fix there is the stink of old C-style code here. As a general rule of
thumb we have adopted that all dynamic array types should be container wrapped.
So you will see a shift from c-string/len pairs to `std::string`, byte*/len
pairs to std::vector<byte>, etc. So if you are in an area of code to fix it
please take that opportunity to fix it up. See our
https://github.com/apache/geode-native/blob/develop/CONTRIBUTING.md guide for
more cleanup tasks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Unable to deserialize membership id java.io.EOFException on locator only when
> debug is enabled and native client is used
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: GEODE-7944
> URL: https://issues.apache.org/jira/browse/GEODE-7944
> Project: Geode
> Issue Type: Bug
> Components: native client
> Reporter: Jakov Varenina
> Assignee: Jakov Varenina
> Priority: Major
> Attachments: locator.log, native_client.log
>
>
> During the creation of pool in geode native with subscription "enabled"
> exception java.io.EOFException is thrown on locator only when it is
> configured with _--log-level=debug_. On geode native this reflects with "No
> locators available". You can find native_client.log and locator.log in
> attachment.
> Native client code:
> {code:java}
> auto cache = cacheFactory.create();
> auto poolFactory = cache.getPoolManager().createFactory();
> auto pool = poolFactory.addLocator("localhost", 10334)
> .setSubscriptionEnabled(true)
> .create("pool");
> {code}
> With java client everything works OK.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)