richardstartin commented on a change in pull request #8083:
URL: https://github.com/apache/pinot/pull/8083#discussion_r796152572



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/transport/ServerChannels.java
##########
@@ -139,22 +143,32 @@ private void attachSSLHandler(SocketChannel ch) {
       }
     }
 
-    synchronized void sendRequest(String rawTableName, AsyncQueryResponse 
asyncQueryResponse,
-        ServerRoutingInstance serverRoutingInstance, InstanceRequest 
instanceRequest)
+    private void sendRequestOrTimeOut(String rawTableName, AsyncQueryResponse 
asyncQueryResponse,
+        ServerRoutingInstance serverRoutingInstance, byte[] requestBytes, long 
timeoutMs)
+        throws Exception {
+      if (_channelLock.tryLock(timeoutMs, TimeUnit.MILLISECONDS)) {
+        try {
+          sendRequest(rawTableName, asyncQueryResponse, serverRoutingInstance, 
requestBytes);
+        } finally {
+          _channelLock.unlock();
+        }
+      }

Review comment:
       Jackie is right, sorry I missed this.
   
   ```
        * @return {@code true} if the lock was free and was acquired by the
        *         current thread, or the lock was already held by the current
        *         thread; and {@code false} if the waiting time elapsed before
        *         the lock could be acquired
        * @throws InterruptedException if the current thread is interrupted
        * @throws NullPointerException if the time unit is null
        */
   ```




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to