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: use unsupported loadbalance will cause nil pointer #120

Merged
merged 4 commits into from
Feb 22, 2019

Conversation

domechn
Copy link
Contributor

@domechn domechn commented Feb 21, 2019

我尝试在gateway中添加权重轮询的负载方式,因为算法需要,我修改了dispatch_runtime.go文件中的clusterRuntime结构体中的svrs里的数据,原先的其中存储了cluster中所有server的id,现在我将svrs中的数据改为*metapb.Server具体的实例。

type clusterRuntime struct {
	meta *metapb.Cluster
	svrs *list.List
	lb   lb.LoadBalance
}

我同时修改了Robin中Select()返回值的类型,原先返回的是index,现在返回的是serverId

@domechn domechn changed the title fix: use unsupported loadbalance will case nil pointer fix: use unsupported loadbalance will cause nil pointer Feb 21, 2019
@zhangxu19830126
Copy link
Member

你在交流群里么?不在加我微信,交流一下。

@zhangxu19830126 zhangxu19830126 merged commit 7d52645 into fagongzi:master Feb 22, 2019
zhangxu19830126 added a commit that referenced this pull request Sep 13, 2019
fix: use unsupported loadbalance will cause nil pointer
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