Skip to content
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

Enforce uniqueness of replication stream #4448

Merged
merged 2 commits into from Jun 8, 2023

Conversation

wxing1292
Copy link
Contributor

@wxing1292 wxing1292 commented Jun 6, 2023

What changed?

  • Enforce uniqueness of replication stream within stream monitor for both sender side & receiver side
  • Consolidate replication stream implementations; move logic to replication package

Why?
Better stream lifecycle control

How did you test it?
UT

Potential risks
N/A

Is hotfix candidate?
N/A

@wxing1292 wxing1292 requested a review from a team as a code owner June 6, 2023 23:13
@wxing1292 wxing1292 force-pushed the better-stream branch 3 times, most recently from f257661 to 3d0eec3 Compare June 7, 2023 23:33
@@ -5,7 +5,7 @@ linters:
- goerr113
- errcheck
- goimports
- paralleltest
# - paralleltest # missing the call to method parallel, but testify does not seem to work well with parallel test: https://github.com/stretchr/testify/issues/187
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MichaelSnowden i am disabling the paralleltest linter since this will not work with testify, see above comments

* Unify stream implementations
service/history/handler.go Outdated Show resolved Hide resolved
h.streamReceiverMonitor.RegisterInboundStream(streamSender)
streamSender.Start()
defer streamSender.Stop()
streamSender.Wait()
Copy link
Contributor

Choose a reason for hiding this comment

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

Will it blocked and timed out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the caller will use a background context

when the context is cancelled, the stream sender will be marked as "stopped" and this wait invocation will unblock


Stream BiDirectionStream[*adminservice.StreamWorkflowReplicationMessagesRequest, *adminservice.StreamWorkflowReplicationMessagesResponse]
StreamReceiver struct {
StreamReceiverImpl struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: streamReceiverImpl?

@wxing1292 wxing1292 merged commit ac1944f into temporalio:master Jun 8, 2023
10 checks passed
@wxing1292 wxing1292 deleted the better-stream branch June 8, 2023 18:18
mindaugasrukas pushed a commit that referenced this pull request Jun 8, 2023
* Enforce uniqueness of replication stream within stream monitor for both sender side & receiver side
* Consolidate replication stream implementations; move logic to replication package
wxing1292 added a commit that referenced this pull request Jun 14, 2023
* Enforce uniqueness of replication stream within stream monitor for both sender side & receiver side
* Consolidate replication stream implementations; move logic to replication package
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.

None yet

2 participants