[
https://issues.apache.org/jira/browse/GEODE-3555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16158937#comment-16158937
]
ASF subversion and git services commented on GEODE-3555:
--------------------------------------------------------
Commit 97f2921ce4565bfc092dffd97e924c952623c9e2 in geode's branch
refs/heads/develop from [~bschuchardt]
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=97f2921 ]
GEODE-3555: proper new client protocol closure with more than max conns.
There was a problem with the configuration of a cache in the new test
method added for this ticket.
> 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)