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

support sticky connection #270

Merged
merged 1 commit into from
Dec 19, 2019
Merged

support sticky connection #270

merged 1 commit into from
Dec 19, 2019

Conversation

CodingSinger
Copy link
Member

support the sticky connection

@codecov-io
Copy link

codecov-io commented Dec 1, 2019

Codecov Report

Merging #270 into develop will decrease coverage by 0.85%.
The diff coverage is 82.6%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #270      +/-   ##
===========================================
- Coverage    66.63%   65.78%   -0.86%     
===========================================
  Files          112      112              
  Lines         7146     7167      +21     
===========================================
- Hits          4762     4715      -47     
- Misses        1922     1990      +68     
  Partials       462      462
Impacted Files Coverage Δ
config/method_config.go 50% <ø> (ø) ⬆️
config/reference_config.go 82.1% <100%> (+0.38%) ⬆️
common/url.go 69.28% <100%> (+0.3%) ⬆️
cluster/cluster_impl/base_cluster_invoker.go 72.46% <77.77%> (+0.76%) ⬆️
protocol/dubbo/pool.go 57.86% <0%> (-15.74%) ⬇️
protocol/dubbo/listener.go 51.19% <0%> (-10.72%) ⬇️
protocol/dubbo/codec.go 76.47% <0%> (-5.89%) ⬇️
remoting/zookeeper/listener.go 46.9% <0%> (-2.58%) ⬇️
protocol/dubbo/readwriter.go 67.9% <0%> (-2.47%) ⬇️
cluster/cluster_impl/failback_cluster_invoker.go 78.49% <0%> (-2.16%) ⬇️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 56cb00a...3c1a96f. Read the comment docs.

package cluster_impl

import (
"context"
Copy link
Contributor

Choose a reason for hiding this comment

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

pls split import to 3 blocks as other files.

Copy link
Member Author

Choose a reason for hiding this comment

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

done~

@skyitachi
Copy link

should stickyInvoker check available?

@CodingSinger CodingSinger changed the base branch from master to develop December 9, 2019 15:47
@CodingSinger
Copy link
Member Author

should stickyInvoker check available?

yes, i have added this logic.

var selectedInvoker protocol.Invoker
url := invokers[0].GetUrl()
sticky := url.GetParam(constant.STICKY_KEY, "false")
//Get the service method sticky config if have
Copy link
Contributor

Choose a reason for hiding this comment

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

GetParamBool

}

if sticky == "true" && invoker.stickyInvoker != nil && (invoked == nil || !isInvoked(invoker.stickyInvoker, invoked)) {
if invoker.availablecheck && invoker.stickyInvoker.IsAvailable() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think sticky should changed to bool type.

Copy link
Contributor

@hxmhlt hxmhlt left a comment

Choose a reason for hiding this comment

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

Pls pay attention to change the func: (invoker *baseClusterInvoker) IsAvailable() bool,if stickyInvoker is not nil, base cluster invoker shouldn't check all invokers.

@hxmhlt hxmhlt merged commit 9604e7a into apache:develop Dec 19, 2019
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.

5 participants