Github user WireBaron commented on a diff in the pull request:

    https://github.com/apache/geode/pull/716#discussion_r133596280
  
    --- Diff: 
geode-core/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpServer.java
 ---
    @@ -334,42 +342,46 @@ protected void run() {
        * fix for bug 33711 - client requests are spun off to another thread 
for processing. Requests are
        * synchronized in processGossip.
        */
    -  private void processRequest(final Socket sock) {
    +  private void processRequest(final Socket socket) {
         executor.execute(() -> {
           long startTime = DistributionStats.getStatTime();
           DataInputStream input = null;
           Object request, response;
           try {
     
    -        sock.setSoTimeout(READ_TIMEOUT);
    -        getSocketCreator().configureServerSSLSocket(sock);
    +        socket.setSoTimeout(READ_TIMEOUT);
    +        getSocketCreator().configureServerSSLSocket(socket);
     
             try {
    -          input = new DataInputStream(sock.getInputStream());
    +          input = new DataInputStream(socket.getInputStream());
             } catch (StreamCorruptedException e) {
               // Some garbage can be left on the socket stream
               // if a peer disappears at exactly the wrong moment.
               log.debug("Discarding illegal request from "
    -              + (sock.getInetAddress().getHostAddress() + ":" + 
sock.getPort()), e);
    +              + (socket.getInetAddress().getHostAddress() + ":" + 
socket.getPort()), e);
               return;
             }
    -        int gossipVersion = readGossipVersion(sock, input);
    +        int gossipVersion = readGossipVersion(socket, input);
     
             short versionOrdinal;
    +        if (gossipVersion == NON_GOSSIP_REQUEST_VERSION) {
    +          if (input.readUnsignedByte() == 
AcceptorImpl.PROTOBUF_CLIENT_SERVER_PROTOCOL
    +              && Boolean.getBoolean("geode.feature-protobuf-protocol")) {
    +            ClientProtocolMessageHandler messageHandler = 
ClientProtocolMessageHandlerLoader.load();
    --- End diff --
    
    Rather than introduce a new static object here, can we just have the 
TcpServer own a messageHandler?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to