Open
Conversation
Contributor
Greptile OverviewGreptile SummaryChanged the stream lookup key in
The change is backward-compatible in behavior since Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Sender as Stream Sender (Origin A)
participant Cell as CoreCell
participant ByteReceiver
participant RxTask
participant Map as rx_task_map
Note over Sender,Map: First chunk arrives (seq=0)
Sender->>Cell: Send stream message (SID=123, Origin=A)
Cell->>ByteReceiver: _data_handler(message)
ByteReceiver->>RxTask: find_or_create_task(message)
RxTask->>Map: get((origin_A, 123))
Map-->>RxTask: None (task not found)
RxTask->>RxTask: Create new RxTask(sid=123, origin=A)
RxTask->>Map: Store task at key (origin_A, 123)
RxTask-->>ByteReceiver: Return new task
ByteReceiver->>ByteReceiver: Invoke stream callback
Note over Sender,Map: Subsequent chunks arrive
Sender->>Cell: Send stream message (SID=123, Origin=A)
Cell->>ByteReceiver: _data_handler(message)
ByteReceiver->>RxTask: find_or_create_task(message)
RxTask->>Map: get((origin_A, 123))
Map-->>RxTask: Return existing task
RxTask->>RxTask: process_chunk(message)
Note over Sender,Map: Final chunk processed
RxTask->>RxTask: stop() called
RxTask->>Map: pop((origin_A, 123))
Map-->>RxTask: Task removed
Note over Map: Key structure prevents collision:<br/>Different origins with same SID<br/>are now stored separately
|
Collaborator
Author
|
/build |
Collaborator
Author
|
/build |
chesterxgchen
approved these changes
Jan 27, 2026
Collaborator
|
/build |
Comment on lines
+20
to
+30
| def generate_stream_ids(num_ids: int, result_queue: mp.Queue) -> None: | ||
| """Worker function to generate stream IDs in a separate process. | ||
|
|
||
| Args: | ||
| num_ids: Number of stream IDs to generate | ||
| result_queue: Queue to put the generated IDs | ||
| """ | ||
| ids = [] | ||
| for _ in range(num_ids): | ||
| ids.append(gen_stream_id()) | ||
| result_queue.put(ids) |
Contributor
There was a problem hiding this comment.
unused helper function, leftover from removed multiprocess tests
Suggested change
| def generate_stream_ids(num_ids: int, result_queue: mp.Queue) -> None: | |
| """Worker function to generate stream IDs in a separate process. | |
| Args: | |
| num_ids: Number of stream IDs to generate | |
| result_queue: Queue to put the generated IDs | |
| """ | |
| ids = [] | |
| for _ in range(num_ids): | |
| ids.append(gen_stream_id()) | |
| result_queue.put(ids) |
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.
Description
Added origin to the stream lookup key to further reduce the chance of a collision.
Types of changes
./runtest.sh.