Skip to content

Add ChannelMarker support on pyAmber - #3245

Merged
shengquan-ni merged 25 commits into
masterfrom
shengquan-add-channel-marker-mgr-py
Feb 19, 2025
Merged

shengquan-ni merged 25 commits into
masterfrom
shengquan-add-channel-marker-mgr-py

Conversation

@shengquan-ni

@shengquan-ni shengquan-ni commented Feb 5, 2025 •

Copy link
Copy Markdown
Contributor

This PR:

  1. Added ChannelMarkerManager to track and align ChannelMarkers on the Python side.
  2. Now messages to Python also attach ChannelIdentity to distinguish different channels, previously we used ActorVirtualIdentity.
  3. Due to the ChannelIdentity change, the generated proto message on Python side has to assign the is_control field explicitly, otherwise its hash is not consistent.
    To give an example:
channel_id = ChannelIdentity(from_worker_id = ..., to_worker_id = ...)
new_channel_id = bytes(channel_id)
assert hash(channel_id) == hash(new_channel_id) // this will fail.
  1. The InputQueue now also uses channel ID as a key, instead of using 2 fixed keys: CONTROL, DATA.

@shengquan-ni shengquan-ni changed the title [WIP] Add ECM support on pyAmber Add ECM support on pyAmber Feb 6, 2025
@shengquan-ni shengquan-ni changed the title Add ECM support on pyAmber Add ChannelMarker support on pyAmber Feb 10, 2025

@aglinxinyuan aglinxinyuan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

We have already discussed the future plan of changing ChannelMarker to ControlMessage offline. This can be done in separate PRs.

@shengquan-ni
shengquan-ni merged commit 74da616 into master Feb 19, 2025
@shengquan-ni
shengquan-ni deleted the shengquan-add-channel-marker-mgr-py branch February 19, 2025 22:36
shengquan-ni added a commit that referenced this pull request Feb 20, 2025
This PR fixes a bug introduced by #3245. Since we are now forcing
channel-level message handling on Python, the source operator's
kickstart message needs a special port and channel so that the internal
processing logic can recognize it.
Ma77Ball pushed a commit that referenced this pull request Apr 2, 2025
This PR:
1. Added ChannelMarkerManager to track and align ChannelMarkers on the
Python side.
2. Now messages to Python also attach ChannelIdentity to distinguish
different channels, previously we used ActorVirtualIdentity.
3. Due to the ChannelIdentity change, the generated proto message on
Python side has to assign the `is_control` field explicitly, otherwise
its hash is not consistent.
To give an example:
```
channel_id = ChannelIdentity(from_worker_id = ..., to_worker_id = ...)
new_channel_id = bytes(channel_id)
assert hash(channel_id) == hash(new_channel_id) // this will fail.
```
4. The InputQueue now also uses channel ID as a key, instead of using 2
fixed keys: CONTROL, DATA.

---------

Co-authored-by: Xinyuan Lin <[email protected]>
Ma77Ball pushed a commit that referenced this pull request Apr 2, 2025
This PR fixes a bug introduced by #3245. Since we are now forcing
channel-level message handling on Python, the source operator's
kickstart message needs a special port and channel so that the internal
processing logic can recognize it.
aglinxinyuan added a commit that referenced this pull request May 15, 2025
Before sending a ChannelMarker, we must verify whether the active
channel falls within the marker's scope. In Python, this check always
returns False, and as a result, the ChannelMarker is never sent
downstream. This occurs because ChannelIdentity instances on the Python
side lack the is_control field, and their hash values are inconsistent —
as noted in PR #3245.
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
This PR:
1. Added ChannelMarkerManager to track and align ChannelMarkers on the
Python side.
2. Now messages to Python also attach ChannelIdentity to distinguish
different channels, previously we used ActorVirtualIdentity.
3. Due to the ChannelIdentity change, the generated proto message on
Python side has to assign the `is_control` field explicitly, otherwise
its hash is not consistent.
To give an example:
```
channel_id = ChannelIdentity(from_worker_id = ..., to_worker_id = ...)
new_channel_id = bytes(channel_id)
assert hash(channel_id) == hash(new_channel_id) // this will fail.
```
4. The InputQueue now also uses channel ID as a key, instead of using 2
fixed keys: CONTROL, DATA.

---------

Co-authored-by: Xinyuan Lin <[email protected]>
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
This PR fixes a bug introduced by apache#3245. Since we are now forcing
channel-level message handling on Python, the source operator's
kickstart message needs a special port and channel so that the internal
processing logic can recognize it.
SarahAsad23 pushed a commit to madisonmlin/texera that referenced this pull request May 20, 2026
Before sending a ChannelMarker, we must verify whether the active
channel falls within the marker's scope. In Python, this check always
returns False, and as a result, the ChannelMarker is never sent
downstream. This occurs because ChannelIdentity instances on the Python
side lack the is_control field, and their hash values are inconsistent —
as noted in PR apache#3245.
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
This PR:
1. Added ChannelMarkerManager to track and align ChannelMarkers on the
Python side.
2. Now messages to Python also attach ChannelIdentity to distinguish
different channels, previously we used ActorVirtualIdentity.
3. Due to the ChannelIdentity change, the generated proto message on
Python side has to assign the `is_control` field explicitly, otherwise
its hash is not consistent.
To give an example:
```
channel_id = ChannelIdentity(from_worker_id = ..., to_worker_id = ...)
new_channel_id = bytes(channel_id)
assert hash(channel_id) == hash(new_channel_id) // this will fail.
```
4. The InputQueue now also uses channel ID as a key, instead of using 2
fixed keys: CONTROL, DATA.

---------

Co-authored-by: Xinyuan Lin <[email protected]>
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
This PR fixes a bug introduced by apache#3245. Since we are now forcing
channel-level message handling on Python, the source operator's
kickstart message needs a special port and channel so that the internal
processing logic can recognize it.
yangzhang75 pushed a commit to yangzhang75/texera that referenced this pull request Jun 22, 2026
Before sending a ChannelMarker, we must verify whether the active
channel falls within the marker's scope. In Python, this check always
returns False, and as a result, the ChannelMarker is never sent
downstream. This occurs because ChannelIdentity instances on the Python
side lack the is_control field, and their hash values are inconsistent —
as noted in PR apache#3245.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants