apache / apache/brpc

SelectiveChannel无法使用一致性哈希模式

Open
#677 3 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
17.6k
Forks
4.1k
Avg merge
2d 12h
Merged PRs (30d)
69

Description

**Describe the bug (描述bug)**
使用SelectiveChannel时,如果使用一致性哈希模式,例如
selective_channel.Init("c_md5", &option)
则,在第二次AddChannel(sub_channel, NULL)时,报错
src/brpc/selective_channel.cpp:197 [AddChannel] Duplicated sub_channel

**To Reproduce (复现方法)**
自带的例子 example/selective_echo_c++中,将FLAGS_load_balancer设为c_md5或c_murmurhash即可复现

**Expected behavior (期望行为)**
正确的将不同的sub_channel添加至一致性哈希的哈希环

**Versions (各种版本)**
OS:ubuntu 16.04 STL
Compiler:gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)
brpc:当前版本
protobuf:libprotoc 3.5.1

**Additional context/screenshots (更多上下文/截图)**
![_15514187991560](https://user-images.githubusercontent.com/16607943/53620070-9060c780-3c2c-11e9-9e9c-59a39d86306a.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.