snleee commented on a change in pull request #4440: Fix the potential resource 
leak from NettyServer
URL: https://github.com/apache/incubator-pinot/pull/4440#discussion_r304574397
 
 

 ##########
 File path: 
pinot-server/src/main/java/org/apache/pinot/server/request/ScheduledRequestHandler.java
 ##########
 @@ -51,20 +49,14 @@ public ScheduledRequestHandler(QueryScheduler 
queryScheduler, ServerMetrics serv
   }
 
   @Override
-  public ListenableFuture<byte[]> processRequest(ChannelHandlerContext 
channelHandlerContext, ByteBuf request) {
+  public ListenableFuture<byte[]> processRequest(byte[] request) {
     long queryArrivalTimeMs = System.currentTimeMillis();
     serverMetrics.addMeteredGlobalValue(ServerMeter.QUERIES, 1);
 
-    LOGGER.debug("Processing request : {}", request);
-
-    byte[] byteArray = new byte[request.readableBytes()];
-    request.readBytes(byteArray);
     SerDe serDe = new SerDe(new TCompactProtocol.Factory());
-    final InstanceRequest instanceRequest = new InstanceRequest();
-
-    if (!serDe.deserialize(instanceRequest, byteArray)) {
-      LOGGER.error("Failed to deserialize query request from broker ip: {}",
-          ((InetSocketAddress) 
channelHandlerContext.channel().remoteAddress()).getAddress().getHostAddress());
+    InstanceRequest instanceRequest = new InstanceRequest();
+    if (!serDe.deserialize(instanceRequest, request)) {
+      LOGGER.error("Failed to deserialize query request: {}", 
BytesUtils.toHexString(request));
 
 Review comment:
   Adding `BytesUtils.toHexString(request)` seems not to add much value on 
debugging?

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to