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

Ftr: Triple Protocol Support #1071

Merged
merged 45 commits into from
Apr 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
789d3b0
ftr: add triple support
LaurenceLiZhixin Mar 1, 2021
8ebf52e
fix: change name
LaurenceLiZhixin Mar 1, 2021
b0bd3d8
Fix: delete unused replace
LaurenceLiZhixin Mar 1, 2021
e0e2993
fix: go fmt
LaurenceLiZhixin Mar 1, 2021
72ae2c1
fix
LaurenceLiZhixin Mar 1, 2021
72e91db
fix: dependency bug
LaurenceLiZhixin Mar 2, 2021
3aa8f1c
fix: dependency bug
LaurenceLiZhixin Mar 2, 2021
e930603
fix: add gen-dubbo3 go mod to pass ci
LaurenceLiZhixin Mar 2, 2021
c5fcc1f
Fix: fix ci lint
LaurenceLiZhixin Mar 2, 2021
956e382
fix: change ci go-version
LaurenceLiZhixin Mar 2, 2021
a96927f
fix: add liscense
LaurenceLiZhixin Mar 2, 2021
3466d14
Fix: change gost version
LaurenceLiZhixin Mar 2, 2021
83ff336
fix: fix cr
LaurenceLiZhixin Mar 7, 2021
7553e83
fix: destroy invoker smoothly
LaurenceLiZhixin Mar 8, 2021
57b92f9
fix: change triple struct
LaurenceLiZhixin Mar 14, 2021
53799e8
Fix: change triple api and add test file
LaurenceLiZhixin Mar 18, 2021
bbc9af2
fix: fix ci
LaurenceLiZhixin Mar 18, 2021
c1f9073
fix: change ctx key type
LaurenceLiZhixin Mar 18, 2021
98100e8
fix: fix linter
LaurenceLiZhixin Mar 18, 2021
c5e638d
fix: fix linter
LaurenceLiZhixin Mar 18, 2021
1d0f9fc
fix: add liscense
LaurenceLiZhixin Mar 18, 2021
95e0460
Fix: fix test
LaurenceLiZhixin Mar 18, 2021
90e3a32
fix: change port
LaurenceLiZhixin Mar 18, 2021
b37dd9f
fix: change port
LaurenceLiZhixin Mar 18, 2021
25cdffb
fix: change port
LaurenceLiZhixin Mar 18, 2021
31d9cd2
fix: change lock range
LaurenceLiZhixin Mar 18, 2021
e4f7549
Fix: delete debug
LaurenceLiZhixin Mar 19, 2021
5a359fa
fix: restart ci
LaurenceLiZhixin Mar 19, 2021
4152114
fix: fix test
LaurenceLiZhixin Mar 19, 2021
a7a2c30
fix: add serializer option
LaurenceLiZhixin Mar 26, 2021
fb540d9
fix: change triple
LaurenceLiZhixin Mar 26, 2021
3452103
fixï: add hessian support
LaurenceLiZhixin Apr 2, 2021
d785615
feat: add triple hessian support
LaurenceLiZhixin Apr 2, 2021
6a76922
fix: change go mod
LaurenceLiZhixin Apr 2, 2021
69136b3
fix: change consul
LaurenceLiZhixin Apr 2, 2021
00ae936
fix: triple finish
LaurenceLiZhixin Apr 3, 2021
e8bad05
fix: fix import block
LaurenceLiZhixin Apr 3, 2021
8b5ac5d
fix: restart ci
LaurenceLiZhixin Apr 3, 2021
5a5103b
fix: restart ci
LaurenceLiZhixin Apr 3, 2021
36fc244
fix: restart ci
LaurenceLiZhixin Apr 3, 2021
9202654
fix: update golang ci
LaurenceLiZhixin Apr 3, 2021
6ff62af
fix: fix conflict
LaurenceLiZhixin Apr 3, 2021
72abb01
fix: fix zk import
LaurenceLiZhixin Apr 3, 2021
9b0e5ea
fix: change ci lint vesion
LaurenceLiZhixin Apr 3, 2021
2d54f5c
fix: conflict
LaurenceLiZhixin Apr 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/creasty/defaults v1.5.1
github.com/dubbogo/go-zookeeper v1.0.2
github.com/dubbogo/gost v1.11.0
github.com/dubbogo/triple v0.0.0-20210318020559-4db55a5388a2
github.com/dubbogo/triple v0.0.0-20210318081906-6fdf7ced4828
github.com/emicklei/go-restful/v3 v3.4.0
github.com/fsnotify/fsnotify v1.4.9
github.com/go-co-op/gocron v0.1.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ github.com/dubbogo/triple v0.0.0-20210314060249-a8daea612f94 h1:njPcvq1+x/RMMKjE
github.com/dubbogo/triple v0.0.0-20210314060249-a8daea612f94/go.mod h1:/jrqKfnQRjI91dFT3cgUuDkG3AuFPTTMOya6RdCiVcE=
github.com/dubbogo/triple v0.0.0-20210318020559-4db55a5388a2 h1:1kHGnzCr5E97Y9fW0G2jg4yXktAe1l0zo2aUthR5gvI=
github.com/dubbogo/triple v0.0.0-20210318020559-4db55a5388a2/go.mod h1:xNXaE2KrRrZfHSaS6ipvMyREzV/LyGeHdjXa9wbTS7Y=
github.com/dubbogo/triple v0.0.0-20210318081906-6fdf7ced4828 h1:/jmL2E+kPB3MY8cK77lUHfDq0zBuTtP5Hn4tA8Uqb2o=
github.com/dubbogo/triple v0.0.0-20210318081906-6fdf7ced4828/go.mod h1:LQDA+Bcob67J7qTEVjotf0+sSFiNUwFNDycWmUZk1w8=
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
Expand Down
18 changes: 12 additions & 6 deletions protocol/dubbo3/dubbo3_protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ var (
type DubboProtocol struct {
protocol.BaseProtocol
serverLock sync.Mutex
serviceMap *sync.Map // is used to export multiple service by one server
serverMap map[string]*triple.TripleServer // It is store relationship about serviceKey(group/interface:version) and ExchangeServer
serviceMap *sync.Map // serviceMap is used to export multiple service by one server
serverMap map[string]*triple.TripleServer // serverMap stores all exported server
}

// NewDubboProtocol create a dubbo protocol.
Expand Down Expand Up @@ -112,10 +112,16 @@ func (dp *DubboProtocol) Refer(url *common.URL) protocol.Invoker {
func (dp *DubboProtocol) Destroy() {
dp.BaseProtocol.Destroy()

// stop server
for key, server := range dp.serverMap {
delete(dp.serverMap, key)
server.Stop()
dp.serverLock.Lock()
defer dp.serverLock.Unlock()
// Stop all server
keyList := make([]string, 16)
Copy link
Contributor

Choose a reason for hiding this comment

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

move this line out of lock, pls.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed!

for k, _ := range dp.serverMap {
keyList = append(keyList, k)
}
for _, v := range keyList {
dp.serverMap[v].Stop()
delete(dp.serverMap, v)
}
}

Expand Down