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

Fix public client default value after xdc switching to gRPC #4560

Merged
merged 4 commits into from
Oct 11, 2021

Conversation

longquanzheng
Copy link
Contributor

@longquanzheng longquanzheng commented Oct 11, 2021

What changed?
Fix public client default value after xdc switching to gRPC

Why?
After this #4492 the default value of publicClient.hostPort is broken because GoSDK doesn't support gRPC yet.
errors about sys-worker startup:

{"level":"warn","ts":"2021-10-11T09:04:33.440-0700","caller":"internal/internal_worker.go:262","msg":"unable to verify if domain exist","Domain":"cadence-system","TaskList":"cadence-sys-processor-parent-close-policy","WorkerID":"42191@IT-USA-25920@cadence-sys-processor-parent-close-policy","WorkerType":"DecisionWorker","domain":"cadence-system","error":"code:unknown message:received unknown error calling service: \"cadence-frontend\", procedure: \"WorkflowService::DescribeDomain\", err: read tcp 127.0.0.1:54418->127.0.0.1:7833: read: connection reset by peer"}
{"level":"info","ts":"2021-10-11T09:04:33.440-0700","caller":"internal/internal_worker.go:834","msg":"Started Workflow Worker","Domain":"cadence-system","TaskList":"cadence-sys-processor-parent-close-policy","WorkerID":"42191@IT-USA-25920@cadence-sys-processor-parent-close-policy"}
{"level":"warn","ts":"2021-10-11T09:04:33.445-0700","caller":"internal/internal_worker.go:262","msg":"unable to verify if domain exist","Domain":"cadence-system","TaskList":"cadence-sys-processor-parent-close-policy","WorkerID":"42191@IT-USA-25920@cadence-sys-processor-parent-close-policy","WorkerType":"ActivityWorker","domain":"cadence-system","error":"code:unknown message:received unknown error calling service: \"cadence-frontend\", procedure: \"WorkflowService::DescribeDomain\", err: read tcp 127.0.0.1:54428->127.0.0.1:7833: read: connection reset by peer"}
{"level":"warn","ts":"2021-10-11T09:04:33.447-0700","caller":"internal/internal_worker.go:262","msg":"unable to verify if domain exist","Domain":"cadence-system","TaskList":"cadence-sys-processor-parent-close-policy","WorkerID":"42191@IT-USA-25920@cadence-sys-processor-parent-close-policy","WorkerType":"LocallyDispatchedActivityWorker","domain":"cadence-system","error":"code:unknown message:received unknown error calling service: \"cadence-frontend\", procedure: \"WorkflowService::DescribeDomain\", err: read tcp 127.0.0.1:54434->127.0.0.1:7833: read: connection reset by peer"}
{"level":"info","ts":"2021-10-11T09:04:33.447-0700","caller":"internal/internal_worker.go:859","msg":"Started Activity Worker","Domain":"cadence-system","TaskList":"cadence-sys-processor-parent-close-policy","WorkerID":"42191@IT-USA-25920@cadence-sys-processor-parent-close-policy"}
{"level":"info","ts":"2021-10-11T09:04:33.447-0700","msg":"First loading dynamic config","service":"cadence-worker","key":"system.enableFailoverManager,clusterName:cluster0","value":"true","default-value":"true","logging-call-at":"config.go:93"}
{"level":"info","ts":"2021-10-11T09:04:33.448-0700","caller":"internal/internal_worker.go:223","msg":"No logger configured for cadence worker. Created default one."}
{"level":"warn","ts":"2021-10-11T09:04:33.450-0700","caller":"internal/internal_worker.go:262","msg":"unable to verify if domain exist","Domain":"cadence-system","TaskList":"cadence-sys-failoverManager-tasklist","WorkerID":"42191@IT-USA-25920@cadence-sys-failoverManager-tasklist","WorkerType":"DecisionWorker","domain":"cadence-system","error":"code:unknown message:received unknown error calling service: \"cadence-frontend\", procedure: \"WorkflowService::DescribeDomain\", err: read tcp 127.0.0.1:54440->127.0.0.1:7833: read: connection reset by peer"}
{"level":"info","ts":"2021-10-11T09:04:33.450-0700","caller":"internal/internal_worker.go:834","msg":"Started Workflow Worker","Domain":"cadence-system","TaskList":"cadence-sys-failoverManager-tasklist","WorkerID":"42191@IT-USA-25920@cadence-sys-failoverManager-tasklist"}

The above errors are gone after this fix.

How did you test it?
Local test.

run make install-schema-xdc and then make cadence-server then ./cadence-server --zone xdc_cluster0 start

Potential risks

Release notes

Documentation Changes

@coveralls
Copy link

coveralls commented Oct 11, 2021

Pull Request Test Coverage Report for Build 28b8b206-2870-45c7-9866-c3ece15ed82e

  • 11 of 13 (84.62%) changed or added relevant lines in 1 file are covered.
  • 57 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+0.05%) to 56.731%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/config/config.go 11 13 84.62%
Files with Coverage Reduction New Missed Lines %
service/history/execution/mutable_state_task_refresher.go 1 73.82%
service/matching/matcher.go 1 91.87%
common/membership/rpServiceResolver.go 2 73.58%
service/history/queue/timer_queue_processor.go 2 59.33%
service/matching/taskListManager.go 2 74.09%
common/cache/lru.go 3 90.73%
common/task/fifoTaskScheduler.go 3 84.54%
common/persistence/serialization/parser.go 4 65.41%
common/persistence/serialization/thrift_decoder.go 4 59.6%
common/persistence/sql/workflowStateMaps.go 11 85.5%
Totals Coverage Status
Change from base Build 28230baa-26b4-44c1-89bb-63d0de08c68e: 0.05%
Covered Lines: 81087
Relevant Lines: 142933

💛 - Coveralls

Copy link
Contributor

@vytautas-karpavicius vytautas-karpavicius left a comment

Choose a reason for hiding this comment

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

Look good, thanks for the fix.

// public client cannot use gRPC because GoSDK hasn't supported it. we need to fallback to Thrift
// TODO: remove this fallback after GoSDK supporting gRPC
thriftPort := c.Services["frontend"].RPC.Port // use the Thrift port from RPC config
hostPort := strings.Split(currentCluster.RPCAddress, ":")
Copy link
Contributor

Choose a reason for hiding this comment

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

Just FYI, Go has dedicated function for such address splitting/joining which has some additional logic: net.SplitHostPort and net.JoinHostPort

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah good point. Will switch to that.

c.PublicClient.HostPort = currentCluster.RPCAddress
} else {
// public client cannot use gRPC because GoSDK hasn't supported it. we need to fallback to Thrift
// TODO: remove this fallback after GoSDK supporting gRPC
Copy link
Contributor

Choose a reason for hiding this comment

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

GoSDK already have gRPC compatibility layer. I'm planning to switch sys worker on the server side soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds great.

@github-actions github-actions bot merged commit aa9e7a5 into master Oct 11, 2021
@github-actions github-actions bot deleted the qlong-fix-public-client branch October 11, 2021 17:56
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.

3 participants