Fix pull_task to enforce server-required minimum timeout#4198
Fix pull_task to enforce server-required minimum timeout#4198YuanTingHsieh wants to merge 4 commits intoNVIDIA:mainfrom
Conversation
Greptile SummaryThis PR fixes a bug in Changes made:
One minor observation:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant Communicator
participant Server
Note over Communicator: self.timeout = 5.0 (initial)
Caller->>Communicator: pull_task(timeout=5.0)
Communicator->>Server: send_request(timeout=5.0)
Server-->>Communicator: response with MIN_GET_TASK_TIMEOUT=360.0
Note over Communicator: self.timeout bumped → 360.0
Caller->>Communicator: pull_task(timeout=30.0)
Note over Communicator: max(30.0, 360.0) = 360.0 ✅
Communicator->>Server: send_request(timeout=360.0)
Caller->>Communicator: pull_task(timeout=400.0)
Note over Communicator: max(400.0, 360.0) = 400.0 ✅
Communicator->>Server: send_request(timeout=400.0)
Caller->>Communicator: pull_task(timeout=None)
Note over Communicator: timeout = self.timeout = 360.0 ✅
Communicator->>Server: send_request(timeout=360.0)
Last reviewed commit: fc2d291 |
|
/build |
There was a problem hiding this comment.
Pull request overview
This pull request fixes a timeout enforcement bug in the client communicator's pull_task method. When tensor streaming is active, the server communicates a minimum required timeout (MIN_GET_TASK_TIMEOUT) to ensure all clients have sufficient time to receive pushed tensors. Previously, if a caller passed a smaller config-based timeout value to pull_task(), it would be used as-is, causing fast clients to time out while the server waits. The fix uses max(timeout, self.timeout) to ensure the caller's larger timeout values are respected while never falling below the server-required minimum.
Changes:
- Modified timeout handling in
pull_task()to enforce server-required minimum timeout - Added explanatory inline comment documenting the rationale for the new behavior
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Additional Comments (1)
This matches the locking discipline already applied to the write site and makes the intent clearer. Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
Summary
Types of changes
./runtest.sh.