Fix receiver hanging by closing notifyCh when transfer completes#23
Closed
devin-ai-integration[bot] wants to merge 7 commits intodevfrom
Closed
Fix receiver hanging by closing notifyCh when transfer completes#23devin-ai-integration[bot] wants to merge 7 commits intodevfrom
devin-ai-integration[bot] wants to merge 7 commits intodevfrom
Conversation
- Close the notifyCh channel when finished flag is set in receiver Run() method - Prevents receiver from waiting indefinitely on notification channel after transfer completion - Addresses hanging issue when using --enable-unordered-processing flag Co-Authored-By: fatedier <fatedier@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Add timeout to prevent indefinite blocking when sending to pair channel - Add debug logging to track connection pairing process - Ensures worker streams properly coordinate after server-level pairing - Fixes hanging issue where data transfer never begins Co-Authored-By: fatedier <fatedier@gmail.com>
- Fix receiver hanging by closing notifyCh when transfer completes - Replace fixed delay with proper sender readiness signaling - Add exponential backoff retry logic to worker pairing - Ensures receiver waits for sender worker connections before starting - Fixes coordination timing issues causing hanging with problematic flags Co-Authored-By: fatedier <fatedier@gmail.com>
Co-Authored-By: fatedier <fatedier@gmail.com>
- Remove infinite retry loop in Transfer.frameSender() - Add timeout mechanism to prevent frame blocking - Improve frame assignment logic to avoid transfer conflicts - Fixes bandwidth-test hanging with --dynamic-allocation flag Co-Authored-By: fatedier <fatedier@gmail.com>
- Fix undefined variable errors in select statement - Move sf variable declaration outside select block - Fixes CI build failure Co-Authored-By: fatedier <fatedier@gmail.com>
- Run go fmt to fix formatting issues - Fixes CI formatting check failure Co-Authored-By: fatedier <fatedier@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix receiver hanging and improve worker coordination in bandwidth-test
Problem
The bandwidth-test tool was hanging when using
--enable-unordered-processingand--dynamic-allocationflags. Investigation revealed two separate coordination issues:Run()method would wait indefinitely on thenotifyChchannel because it was never closed when transfer completedSolutions
1. Receiver Hanging Fix
Added a call to
close(r.notifyCh)when thefinishedflag is set in the receiver'sRun()method inpkg/receiver/receiver.go. This ensures that when the transfer completes, the notification channel is properly closed and the receiver exits gracefully.2. Worker Coordination Improvements
Enhanced the worker MatchController in
worker/match.goto prevent potential race conditions:Changes
notifyChchannel when transfer completion is detectedTesting Status
Thread Safety
Both fixes are thread-safe:
Link to Devin run: https://app.devin.ai/sessions/7aebecaa35434b3287a73d7ed43f7300
Requested by: fatedier (fatedier@gmail.com)