Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
58ce465b
Commit
58ce465b
authored
4 years ago
by
wangwx
Browse files
Options
Downloads
Patches
Plain Diff
fix ut error
parent
887956da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
remoting/zookeeper/client.go
+0
-8
0 additions, 8 deletions
remoting/zookeeper/client.go
remoting/zookeeper/facade.go
+0
-3
0 additions, 3 deletions
remoting/zookeeper/facade.go
remoting/zookeeper/facade_test.go
+0
-2
0 additions, 2 deletions
remoting/zookeeper/facade_test.go
with
0 additions
and
13 deletions
remoting/zookeeper/client.go
+
0
−
8
View file @
58ce465b
...
...
@@ -63,7 +63,6 @@ type ZookeeperClient struct {
Wait
sync
.
WaitGroup
valid
uint32
reconnectCh
chan
struct
{}
closeCh
chan
struct
{}
eventRegistry
map
[
string
][]
*
chan
struct
{}
eventRegistryLock
sync
.
RWMutex
}
...
...
@@ -178,7 +177,6 @@ func NewZookeeperClient(name string, zkAddrs []string, timeout time.Duration) (*
ZkAddrs
:
zkAddrs
,
Timeout
:
timeout
,
reconnectCh
:
make
(
chan
struct
{}),
closeCh
:
make
(
chan
struct
{}),
eventRegistry
:
make
(
map
[
string
][]
*
chan
struct
{}),
}
// connect to zookeeper
...
...
@@ -213,7 +211,6 @@ func NewMockZookeeperClient(name string, timeout time.Duration, opts ...Option)
ZkAddrs
:
[]
string
{},
Timeout
:
timeout
,
reconnectCh
:
make
(
chan
struct
{}),
closeCh
:
make
(
chan
struct
{}),
eventRegistry
:
make
(
map
[
string
][]
*
chan
struct
{}),
}
...
...
@@ -603,11 +600,6 @@ func (z *ZookeeperClient) Reconnect() <-chan struct{} {
return
z
.
reconnectCh
}
// CloseConn gets zookeeper client close event
func
(
z
*
ZookeeperClient
)
CloseConn
()
<-
chan
struct
{}
{
return
z
.
closeCh
}
// In my opinion, this method should never called by user, here just for lint
func
(
z
*
ZookeeperClient
)
Close
()
{
z
.
Conn
.
Close
()
...
...
This diff is collapsed.
Click to expand it.
remoting/zookeeper/facade.go
+
0
−
3
View file @
58ce465b
...
...
@@ -48,9 +48,6 @@ func HandleClientRestart(r ZkClientFacade) {
case
<-
r
.
Done
()
:
logger
.
Warnf
(
"receive registry destroy event, quit client restart handler"
)
return
case
<-
r
.
ZkClient
()
.
CloseConn
()
:
logger
.
Warnf
(
"receive zk client close event, quit client restart handler"
)
return
}
}
}
This diff is collapsed.
Click to expand it.
remoting/zookeeper/facade_test.go
+
0
−
2
View file @
58ce465b
...
...
@@ -100,6 +100,4 @@ func Test_Facade(t *testing.T) {
go
HandleClientRestart
(
mock
)
states
:=
[]
zk
.
State
{
zk
.
StateConnecting
,
zk
.
StateConnected
,
zk
.
StateHasSession
}
verifyEventStateOrder
(
t
,
event
,
states
,
"event channel"
)
verifyEventStateOrder
(
t
,
event
,
[]
zk
.
State
{
zk
.
StateDisconnected
},
"event channel"
)
//time.Sleep(2e9)
}
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment