Skip to content

Commit afc1696

Browse files
Dmitriy Karpukhindkarpukhin
Dmitriy Karpukhin
authored andcommitted
add more timeouts for http transport
1 parent 4c8325e commit afc1696

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

isolate/porto/box.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ func NewBox(ctx context.Context, cfg isolate.BoxConfig, gstate isolate.GlobalSta
148148
for i := 0; i <= config.DialRetries; i++ {
149149
dialer := net.Dialer{
150150
DualStack: true,
151+
KeepAlive: 10 * time.Second,
151152
Timeout: 5 * time.Second,
152153
}
153154
conn, err := dialer.Dial(network, addr)
@@ -160,6 +161,9 @@ func NewBox(ctx context.Context, cfg isolate.BoxConfig, gstate isolate.GlobalSta
160161
}
161162
return nil, fmt.Errorf("no retries available")
162163
},
164+
IdleConnTimeout: 120 * time.Second,
165+
TLSHandshakeTimeout: 60 * time.Second,
166+
ExpectContinueTimeout: 5 * time.Second,
163167
}
164168

165169
portoConn, err := portoConnect()

0 commit comments

Comments
 (0)