Copilot commented on code in PR #2304:
URL: 
https://github.com/apache/incubator-pegasus/pull/2304#discussion_r2436531151


##########
python-client/pypegasus/operate/packet.py:
##########
@@ -74,7 +74,8 @@ def __init__(self, gpid=gpid(), request=None, 
partition_hash=0):
         self.request = request
         self.response = None
 
-    def prepare_thrift_header(self, body_length):
+    def prepare_thrift_header(self, body_length, timeout):
+        self.header.client_timeout = timeout

Review Comment:
   The timeout parameter should be validated to ensure it's not None or 
negative before assignment. If timeout is None (which can happen when no 
timeout is specified in the operate call), this will set client_timeout to 
None, which may not be the intended behavior.
   ```suggestion
           # Validate timeout: must not be None or negative
           if timeout is None or timeout < 0:
               client_timeout = 0
           else:
               client_timeout = timeout
           self.header.client_timeout = client_timeout
   ```



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