Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
cf706531
Commit
cf706531
authored
Apr 17, 2019
by
Ted Yu
Committed by
Ted Yu
Apr 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use read lock for ServiceHasEndpoints
parent
0889c3e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
roundrobin.go
pkg/proxy/userspace/roundrobin.go
+2
-2
No files found.
pkg/proxy/userspace/roundrobin.go
View file @
cf706531
...
@@ -122,8 +122,8 @@ func isSessionAffinity(affinity *affinityPolicy) bool {
...
@@ -122,8 +122,8 @@ func isSessionAffinity(affinity *affinityPolicy) bool {
// ServiceHasEndpoints checks whether a service entry has endpoints.
// ServiceHasEndpoints checks whether a service entry has endpoints.
func
(
lb
*
LoadBalancerRR
)
ServiceHasEndpoints
(
svcPort
proxy
.
ServicePortName
)
bool
{
func
(
lb
*
LoadBalancerRR
)
ServiceHasEndpoints
(
svcPort
proxy
.
ServicePortName
)
bool
{
lb
.
lock
.
Lock
()
lb
.
lock
.
R
Lock
()
defer
lb
.
lock
.
Unlock
()
defer
lb
.
lock
.
R
Unlock
()
state
,
exists
:=
lb
.
services
[
svcPort
]
state
,
exists
:=
lb
.
services
[
svcPort
]
// TODO: while nothing ever assigns nil to the map, *some* of the code using the map
// TODO: while nothing ever assigns nil to the map, *some* of the code using the map
// checks for it. The code should all follow the same convention.
// checks for it. The code should all follow the same convention.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment