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
8f61206c
Commit
8f61206c
authored
5 years ago
by
邹毅贤
Browse files
Options
Downloads
Patches
Plain Diff
change lock granularity
parent
e743230f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
registry/zookeeper/listener.go
+2
-2
2 additions, 2 deletions
registry/zookeeper/listener.go
registry/zookeeper/registry.go
+6
-3
6 additions, 3 deletions
registry/zookeeper/registry.go
with
8 additions
and
5 deletions
registry/zookeeper/listener.go
+
2
−
2
View file @
8f61206c
...
...
@@ -58,13 +58,13 @@ func (l *RegistryDataListener) SubscribeURL(url *common.URL, listener config_cen
// SubscribeURL is used to set a watch listener for url
func
(
l
*
RegistryDataListener
)
UnSubscribeURL
(
url
*
common
.
URL
)
config_center
.
ConfigurationListener
{
l
.
mutex
.
Lock
()
defer
l
.
mutex
.
Unlock
()
if
l
.
closed
{
return
nil
}
l
.
mutex
.
Lock
()
listener
:=
l
.
subscribed
[
url
]
delete
(
l
.
subscribed
,
url
)
l
.
mutex
.
Unlock
()
return
listener
}
...
...
This diff is collapsed.
Click to expand it.
registry/zookeeper/registry.go
+
6
−
3
View file @
8f61206c
...
...
@@ -285,16 +285,19 @@ func (r *zkRegistry) getCloseListener(conf *common.URL) (*RegistryConfigurationL
}
}
zkListener
=
r
.
dataListener
.
UnSubscribeURL
(
conf
)
.
(
*
RegistryConfigurationListener
)
zkListener
=
dataListener
.
UnSubscribeURL
(
conf
)
.
(
*
RegistryConfigurationListener
)
if
r
.
listener
==
nil
{
return
nil
,
perrors
.
New
(
"listener is null can not close."
)
}
//Interested register to dataconfig.
r
.
listenerLock
.
Lock
()
r
.
dataListener
.
Close
()
r
.
listener
.
Close
()
listener
:=
r
.
listener
r
.
listener
=
nil
r
.
listenerLock
.
Unlock
()
dataListener
.
Close
()
listener
.
Close
()
return
zkListener
,
nil
}
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