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
d52b1568
Commit
d52b1568
authored
4 years ago
by
zengfanwei
Browse files
Options
Downloads
Patches
Plain Diff
rollback
parent
1871621b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
protocol/protocolwrapper/protocol_filter_wrapper.go
+0
-4
0 additions, 4 deletions
protocol/protocolwrapper/protocol_filter_wrapper.go
remoting/zookeeper/client.go
+2
-2
2 additions, 2 deletions
remoting/zookeeper/client.go
remoting/zookeeper/listener.go
+3
-5
3 additions, 5 deletions
remoting/zookeeper/listener.go
with
5 additions
and
11 deletions
protocol/protocolwrapper/protocol_filter_wrapper.go
+
0
−
4
View file @
d52b1568
...
@@ -68,10 +68,6 @@ func (pfw *ProtocolFilterWrapper) Destroy() {
...
@@ -68,10 +68,6 @@ func (pfw *ProtocolFilterWrapper) Destroy() {
}
}
func
buildInvokerChain
(
invoker
protocol
.
Invoker
,
key
string
)
protocol
.
Invoker
{
func
buildInvokerChain
(
invoker
protocol
.
Invoker
,
key
string
)
protocol
.
Invoker
{
if
invoker
==
nil
{
return
invoker
}
filterName
:=
invoker
.
GetUrl
()
.
GetParam
(
key
,
""
)
filterName
:=
invoker
.
GetUrl
()
.
GetParam
(
key
,
""
)
if
filterName
==
""
{
if
filterName
==
""
{
return
invoker
return
invoker
...
...
This diff is collapsed.
Click to expand it.
remoting/zookeeper/client.go
+
2
−
2
View file @
d52b1568
...
@@ -38,7 +38,7 @@ const (
...
@@ -38,7 +38,7 @@ const (
// ConnDelay connection delay interval
// ConnDelay connection delay interval
ConnDelay
=
3
ConnDelay
=
3
// MaxFailTimes max fail times
// MaxFailTimes max fail times
MaxFailTimes
=
3
MaxFailTimes
=
15
)
)
var
(
var
(
...
@@ -259,6 +259,7 @@ func (z *ZookeeperClient) HandleZkEvent(session <-chan zk.Event) {
...
@@ -259,6 +259,7 @@ func (z *ZookeeperClient) HandleZkEvent(session <-chan zk.Event) {
switch
(
int
)(
event
.
State
)
{
switch
(
int
)(
event
.
State
)
{
case
(
int
)(
zk
.
StateDisconnected
)
:
case
(
int
)(
zk
.
StateDisconnected
)
:
logger
.
Warnf
(
"zk{addr:%s} state is StateDisconnected, so close the zk client{name:%s}."
,
z
.
ZkAddrs
,
z
.
name
)
logger
.
Warnf
(
"zk{addr:%s} state is StateDisconnected, so close the zk client{name:%s}."
,
z
.
ZkAddrs
,
z
.
name
)
z
.
stop
()
z
.
Lock
()
z
.
Lock
()
conn
:=
z
.
Conn
conn
:=
z
.
Conn
z
.
Conn
=
nil
z
.
Conn
=
nil
...
@@ -266,7 +267,6 @@ func (z *ZookeeperClient) HandleZkEvent(session <-chan zk.Event) {
...
@@ -266,7 +267,6 @@ func (z *ZookeeperClient) HandleZkEvent(session <-chan zk.Event) {
if
conn
!=
nil
{
if
conn
!=
nil
{
conn
.
Close
()
conn
.
Close
()
}
}
z
.
stop
()
return
return
case
(
int
)(
zk
.
EventNodeDataChanged
),
(
int
)(
zk
.
EventNodeChildrenChanged
)
:
case
(
int
)(
zk
.
EventNodeDataChanged
),
(
int
)(
zk
.
EventNodeChildrenChanged
)
:
logger
.
Infof
(
"zkClient{%s} get zk node changed event{path:%s}"
,
z
.
name
,
event
.
Path
)
logger
.
Infof
(
"zkClient{%s} get zk node changed event{path:%s}"
,
z
.
name
,
event
.
Path
)
...
...
This diff is collapsed.
Click to expand it.
remoting/zookeeper/listener.go
+
3
−
5
View file @
d52b1568
...
@@ -134,7 +134,7 @@ func (l *ZkEventListener) handleZkNodeEvent(zkPath string, children []string, li
...
@@ -134,7 +134,7 @@ func (l *ZkEventListener) handleZkNodeEvent(zkPath string, children []string, li
newChildren
,
err
:=
l
.
client
.
GetChildren
(
zkPath
)
newChildren
,
err
:=
l
.
client
.
GetChildren
(
zkPath
)
if
err
!=
nil
{
if
err
!=
nil
{
/*
if err == errNilChildren {
if
err
==
errNilChildren
{
content
,
_
,
err
:=
l
.
client
.
Conn
.
Get
(
zkPath
)
content
,
_
,
err
:=
l
.
client
.
Conn
.
Get
(
zkPath
)
if
err
!=
nil
{
if
err
!=
nil
{
logger
.
Errorf
(
"Get new node path {%v} 's content error,message is {%v}"
,
zkPath
,
perrors
.
WithStack
(
err
))
logger
.
Errorf
(
"Get new node path {%v} 's content error,message is {%v}"
,
zkPath
,
perrors
.
WithStack
(
err
))
...
@@ -144,9 +144,7 @@ func (l *ZkEventListener) handleZkNodeEvent(zkPath string, children []string, li
...
@@ -144,9 +144,7 @@ func (l *ZkEventListener) handleZkNodeEvent(zkPath string, children []string, li
}
else
{
}
else
{
logger
.
Errorf
(
"path{%s} child nodes changed, zk.Children() = error{%v}"
,
zkPath
,
perrors
.
WithStack
(
err
))
logger
.
Errorf
(
"path{%s} child nodes changed, zk.Children() = error{%v}"
,
zkPath
,
perrors
.
WithStack
(
err
))
}*/
}
logger
.
Errorf
(
"path{%s} child nodes are empty, zk.Children() = error{%v}"
,
zkPath
,
perrors
.
WithStack
(
err
))
return
}
}
// a node was added -- listen the new node
// a node was added -- listen the new node
...
@@ -253,7 +251,7 @@ func (l *ZkEventListener) listenDirEvent(conf *common.URL, zkPath string, listen
...
@@ -253,7 +251,7 @@ func (l *ZkEventListener) listenDirEvent(conf *common.URL, zkPath string, listen
case
<-
event
:
case
<-
event
:
logger
.
Infof
(
"get zk.EventNodeDataChange notify event"
)
logger
.
Infof
(
"get zk.EventNodeDataChange notify event"
)
l
.
client
.
UnregisterEvent
(
zkPath
,
&
event
)
l
.
client
.
UnregisterEvent
(
zkPath
,
&
event
)
l
.
handleZkNodeEvent
(
zkPath
,
children
,
listener
)
l
.
handleZkNodeEvent
(
zkPath
,
nil
,
listener
)
continue
continue
}
}
}
}
...
...
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