-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: worker selection and worker package refactor #482
Conversation
- Separate out localWorker to send local work requests - Separate out remoteWorker to enable selection and handling of remote work requests - Lay foundation for remote worker selection - even though queue is limited all remoteWorkers still get the same request which is inefficient - Log number of responses in the queue - Make logs verbose for easy debugging of localWork and remoteWork
…cessing - Add round-robin iterator for fair worker distribution - Prioritize local worker when eligible - Cycle through remote workers in subsequent calls - Improve error handling and logging for worker responses - Enhance code readability and maintainability This update ensures a balanced workload across all available workers over time, while still prioritizing local processing when possible.
- Add maxSpawnAttempts constant to limit remote worker spawn attempts - Implement retry mechanism for spawning remote workers with exponential backoff - Introduce spawnRemoteWorker function for better organization and error handling - Enhance logging for better visibility into worker spawning and processing - Improve handling of dead letters and timeouts in remote worker operations - Refactor handleRemoteWorker to be more robust against transient failures - Update tryWorker function to handle both local and remote worker scenarios - Implement round-robin worker selection with retries in SendWork function These changes aim to increase the reliability of the worker system, particularly when dealing with remote workers, and provide better insights into error scenarios for easier debugging and monitoring.
- Created new file worker_selection.go to house worker selection logic - Moved GetEligibleWorkers, isEligibleRemoteWorker, and RoundRobinIterator to worker_selection.go - Updated send_work.go to use new exported functions from worker_selection.go - Renamed newRoundRobinIterator to NewRoundRobinIterator for proper exporting - Updated imports and function calls in send_work.go to reflect new structure - Improved code organization and modularity
PR description is too short and seems to not fulfill PR template, please fill in |
PR description is too short and seems to not fulfill PR template, please fill in |
PR description is too short and seems to not fulfill PR template, please fill in |
- Refactored `tryWorkersRoundRobin` to `tryWorkersConcurrently` to call `tryWorker` for each worker asynchronously. - Simplified response collection using a single `responseCollector` channel. - Updated `tryWorker` to directly process workers and send responses to `responseCollector`. This change improves the concurrency model by allowing all workers to process simultaneously and collecting the first successful response.
PR description is too short and seems to not fulfill PR template, please fill in |
Refactored worker selection to use NodeTracker's new GetEligibleWorkerNodes method and introduced an eligibility check for staked workers. Added a new utility function for converting strings to WorkerTypes and a method in NodeEventTracker to retrieve eligible nodes based on work categories.
PR description is too short and seems to not fulfill PR template, please fill in |
Hey |
PR description is too short and seems to not fulfill PR template, please fill in |
PR description is too short and seems to not fulfill PR template, please fill in |
Description
This PR fixes #
Notes for Reviewers
Signed commits