Architecture Design Question: Client.scheduler_stream vs. Client.scheduler
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 778
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 3
Description
This is just a question to try to understand the internals surrounding the connection streams between Client and Scheduler.
The client seems to use two different streams to communicate with the scheduler- the first is the RPC object Client.scheduler, which is used by functions such as get_dataset/publish_dataset/etc. The other is Client.scheduler_stream, which is created inside Client.ensure_connected()
Is there any fundamental reason for using two separate streams? It seems Client.scheduler_stream uses BatchedSend and is used for sending/receiving small messages, and Client.scheduler is the only one used for receiving potentially large amounts of data.
On the Scheduler side, I see how the handlers are separated into self.handlers and self.client_handlers which correspond to the two different streams.
Contributor guide
Research direction
Start with Client.ensure_connected() and trace Client.scheduler, Client.scheduler_stream, BatchedSend, and the Scheduler handlers in self.handlers and self.client_handlers. Compare the two connection paths and record the architectural rationale; done means a clear explanation of why the streams differ and which message sizes or handlers use each.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100