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
18ad5f8c
Commit
18ad5f8c
authored
Oct 19, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15745 from ArtfulCoder/reduceTimeout
Auto commit by PR queue bot
parents
95b8394a
de214829
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
proxysocket.go
pkg/proxy/userspace/proxysocket.go
+3
-3
No files found.
pkg/proxy/userspace/proxysocket.go
View file @
18ad5f8c
...
...
@@ -73,7 +73,7 @@ func newProxySocket(protocol api.Protocol, ip net.IP, port int) (proxySocket, er
}
// How long we wait for a connection to a backend in seconds
var
endpointDialTimeout
=
[]
time
.
Duration
{
1
,
2
,
4
,
8
}
var
endpointDialTimeout
=
[]
time
.
Duration
{
250
*
time
.
Millisecond
,
500
*
time
.
Millisecond
,
1
*
time
.
Second
,
2
*
time
.
Second
}
// tcpProxySocket implements proxySocket. Close() is implemented by net.Listener. When Close() is called,
// no new connections are allowed but existing connections are left untouched.
...
...
@@ -87,7 +87,7 @@ func (tcp *tcpProxySocket) ListenPort() int {
}
func
tryConnect
(
service
proxy
.
ServicePortName
,
srcAddr
net
.
Addr
,
protocol
string
,
proxier
*
Proxier
)
(
out
net
.
Conn
,
err
error
)
{
for
_
,
retry
Timeout
:=
range
endpointDialTimeout
{
for
_
,
dial
Timeout
:=
range
endpointDialTimeout
{
endpoint
,
err
:=
proxier
.
loadBalancer
.
NextEndpoint
(
service
,
srcAddr
)
if
err
!=
nil
{
glog
.
Errorf
(
"Couldn't find an endpoint for %s: %v"
,
service
,
err
)
...
...
@@ -96,7 +96,7 @@ func tryConnect(service proxy.ServicePortName, srcAddr net.Addr, protocol string
glog
.
V
(
3
)
.
Infof
(
"Mapped service %q to endpoint %s"
,
service
,
endpoint
)
// TODO: This could spin up a new goroutine to make the outbound connection,
// and keep accepting inbound traffic.
outConn
,
err
:=
net
.
DialTimeout
(
protocol
,
endpoint
,
retryTimeout
*
time
.
Second
)
outConn
,
err
:=
net
.
DialTimeout
(
protocol
,
endpoint
,
dialTimeout
)
if
err
!=
nil
{
if
isTooManyFDsError
(
err
)
{
panic
(
"Dial failed: "
+
err
.
Error
())
...
...
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