Skip to content

Conversation

@hai719
Copy link
Contributor

@hai719 hai719 commented Nov 17, 2025

What was changed

Refactor current stream forwarding code into StreamForwarder.

Why?

Later we will add StreamSender, StreamReceiver to support proxy routing of replication messages. Refactor existing code into StreamForwarder will make code structure more clear.

Checklist

  1. Closes

  2. How was this tested:
    Covered by existing tests.

  3. Any docs updates needed?

@hai719 hai719 changed the title Refactor current stream forwarding code into StreamForwarder. Refactor current stream forwarding code into StreamForwarder Nov 17, 2025
@hai719 hai719 requested a review from temporal-nick November 17, 2025 21:47
@hai719 hai719 marked this pull request as ready for review November 17, 2025 21:47
@hai719 hai719 requested a review from a team as a code owner November 17, 2025 21:47
Copy link
Contributor

@temporal-nick temporal-nick left a comment

Choose a reason for hiding this comment

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

High-level comment: this code was written before I learned more about Contexts, it may be possible to also clean up the Recv() code by using the targetStreamServer.Context() to exit early. I haven't looked into whether that is definitely the case though.

defer cancel()

// The underlying adminClient will try to grab a connection when we call StreamWorkflowReplicationMessages.
// The connection is separately managed, so we want to see how long it takes to establish that conn.
Copy link
Contributor

Choose a reason for hiding this comment

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

Dead comment, nothing is monitoring the time here

// ^targetStreamServer ^sourceStreamClient
//
// We can freely close sourceStreamClient with closeSend. gRPC will only cancel targetStreamServer when we return from
// this function.
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment out of date: "...when we return from the service handler"

@hai719 hai719 merged commit 6912a6a into temporalio:main Nov 17, 2025
5 checks passed
@hai719 hai719 deleted the hai719/forwarder branch November 17, 2025 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants