You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Anthony Baker (JIRA)" <ji...@apache.org> on 2018/04/20 19:54:20 UTC
[jira] [Closed] (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:all-tabpanel ]
Anthony Baker closed GEODE-3555.
--------------------------------
> 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
> Priority: Major
> 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
(v7.6.3#76005)