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 2017/09/07 17:29:00 UTC
[jira] [Commented] (GEODE-3555) Protobuf clients are rejected with
an old-client-specific message.
[ https://issues.apache.org/jira/browse/GEODE-3555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16157284#comment-16157284 ]
ASF subversion and git services commented on GEODE-3555:
--------------------------------------------------------
Commit b92b9a9b0dcaa7f2095d43c02cd9e8141fe45fc8 in geode's branch refs/heads/develop from [~bschuchardt]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=b92b9a9 ]
GEODE-3555: proper new client protocol closure with more than max conns.
Don't send an old client message when closing new client connections.
This test also tests GEODE-3077.
This closes #756
Signed-off-by: Galen O'Sullivan <go...@pivotal.io>
> Protobuf clients are rejected with an old-client-specific message.
> ------------------------------------------------------------------
>
> Key: GEODE-3555
> URL: https://issues.apache.org/jira/browse/GEODE-3555
> Project: Geode
> Issue Type: Bug
> Components: messaging
> Reporter: Galen O'Sullivan
> Fix For: 1.3.0
>
>
> If the number of client connections is above the configured maximum, new client connections will be rejected with a message that is meant for old clients and, to them, is unintelligible.
> This can be seen with the following test added to {{RoundTripCacheConnectionJUnitTest}}:
> {code}
> @Test
> public void testNewProtocolRespectsMaxConnectionLimit()
> throws IOException, InterruptedException {
> cache.close();
> CacheFactory cacheFactory = new CacheFactory();
> Cache cache = cacheFactory.create();
> CacheServer cacheServer = cache.addCacheServer();
> final int cacheServerPort = AvailablePortHelper.getRandomAvailableTCPPort();
> cacheServer.setPort(cacheServerPort);
> cacheServer.setMaxConnections(16);
> cacheServer.setMaxThreads(16);
> cacheServer.start();
> AcceptorImpl acceptor = ((CacheServerImpl) cacheServer).getAcceptor();
> Socket[] sockets = new Socket[16];
> for (int i = 0; i < 16; i++) {
> Socket socket = new Socket("localhost", cacheServerPort);
> sockets[i] = socket;
> Awaitility.await().atMost(5, TimeUnit.SECONDS).until(socket::isConnected);
> socket.getOutputStream().write(CommunicationMode.ProtobufClientServerProtocol.getModeNumber());
> }
> try (Socket socket = new Socket("localhost", cacheServerPort)) {
> Awaitility.await().atMost(5, TimeUnit.SECONDS).until(socket::isConnected);
> OutputStream outputStream = socket.getOutputStream();
> outputStream
> .write(CommunicationMode.ProtobufClientServerProtocol.getModeNumber());
> assertEquals(-1, socket.getInputStream().read());
> }
> {code}
> This can be traced to a call to {{ServerHandShakeProcessor.refuse(socket.getOutputStream(), ...}} .
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)