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
5f0288e0
Commit
5f0288e0
authored
May 22, 2017
by
Random-Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Double `StopContainer` request timeout.
parent
b6211c6e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
remote_runtime.go
pkg/kubelet/remote/remote_runtime.go
+4
-5
No files found.
pkg/kubelet/remote/remote_runtime.go
View file @
5f0288e0
...
@@ -209,11 +209,10 @@ func (r *RemoteRuntimeService) StartContainer(containerID string) error {
...
@@ -209,11 +209,10 @@ func (r *RemoteRuntimeService) StartContainer(containerID string) error {
// StopContainer stops a running container with a grace period (i.e., timeout).
// StopContainer stops a running container with a grace period (i.e., timeout).
func
(
r
*
RemoteRuntimeService
)
StopContainer
(
containerID
string
,
timeout
int64
)
error
{
func
(
r
*
RemoteRuntimeService
)
StopContainer
(
containerID
string
,
timeout
int64
)
error
{
ctx
,
cancel
:=
getContextWithTimeout
(
time
.
Duration
(
timeout
)
*
time
.
Second
)
// Use timeout + default timeout (2 minutes) as timeout to leave extra time
if
timeout
==
0
{
// for SIGKILL container and request latency.
// Use default timeout if stop timeout is 0.
t
:=
r
.
timeout
+
time
.
Duration
(
timeout
)
*
time
.
Second
ctx
,
cancel
=
getContextWithTimeout
(
r
.
timeout
)
ctx
,
cancel
:=
getContextWithTimeout
(
t
)
}
defer
cancel
()
defer
cancel
()
_
,
err
:=
r
.
runtimeClient
.
StopContainer
(
ctx
,
&
runtimeapi
.
StopContainerRequest
{
_
,
err
:=
r
.
runtimeClient
.
StopContainer
(
ctx
,
&
runtimeapi
.
StopContainerRequest
{
...
...
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