Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
baf6d38b
Unverified
Commit
baf6d38b
authored
Jun 23, 2020
by
Christian Brauner
Committed by
GitHub
Jun 23, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3456 from brauner/2020-06-23/lxc_stop_fixes
lxccontainer: fix non-blocking container stop
parents
91dd15a4
60cd5091
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
lxccontainer.c
src/lxc/lxccontainer.c
+28
-28
No files found.
src/lxc/lxccontainer.c
View file @
baf6d38b
...
...
@@ -2090,41 +2090,41 @@ static bool do_lxcapi_shutdown(struct lxc_container *c, int timeout)
if
(
ret
<
MAX_STATE
)
return
false
;
}
if
(
pidfd
>=
0
)
{
struct
pollfd
pidfd_poll
=
{
.
events
=
POLLIN
,
.
fd
=
pidfd
,
};
if
(
pidfd
>=
0
)
{
struct
pollfd
pidfd_poll
=
{
.
events
=
POLLIN
,
.
fd
=
pidfd
,
};
killret
=
lxc_raw_pidfd_send_signal
(
pidfd
,
haltsignal
,
NULL
,
0
);
if
(
killret
<
0
)
return
log_warn
(
false
,
"Failed to send signal %d to pidfd %d"
,
haltsignal
,
pidfd
);
killret
=
lxc_raw_pidfd_send_signal
(
pidfd
,
haltsignal
,
NULL
,
0
);
if
(
killret
<
0
)
return
log_warn
(
false
,
"Failed to send signal %d to pidfd %d"
,
haltsignal
,
pidfd
);
TRACE
(
"Sent signal %d to pidfd %d"
,
haltsignal
,
pidfd
);
TRACE
(
"Sent signal %d to pidfd %d"
,
haltsignal
,
pidfd
);
/*
* No need for going through all of the state server
* complications anymore. We can just poll on pidfds. :)
*/
/*
* No need for going through all of the state server
* complications anymore. We can just poll on pidfds. :)
*/
if
(
timeout
!=
0
)
{
ret
=
poll
(
&
pidfd_poll
,
1
,
timeout
*
1000
);
if
(
ret
<
0
||
!
(
pidfd_poll
.
revents
&
POLLIN
))
return
false
;
if
(
timeout
!=
0
)
{
ret
=
poll
(
&
pidfd_poll
,
1
,
timeout
*
1000
);
if
(
ret
<
0
||
!
(
pidfd_poll
.
revents
&
POLLIN
))
return
false
;
TRACE
(
"Pidfd polling detected container exit"
);
}
}
else
{
killret
=
kill
(
pid
,
haltsignal
);
if
(
killret
<
0
)
return
log_warn
(
false
,
"Failed to send signal %d to pid %d"
,
haltsignal
,
pid
);
TRACE
(
"Sent signal %d to pid %d"
,
haltsignal
,
pid
);
TRACE
(
"Pidfd polling detected container exit"
);
}
}
else
{
killret
=
kill
(
pid
,
haltsignal
);
if
(
killret
<
0
)
return
log_warn
(
false
,
"Failed to send signal %d to pid %d"
,
haltsignal
,
pid
);
TRACE
(
"Sent signal %d to pid %d"
,
haltsignal
,
pid
);
}
if
(
timeout
==
0
)
...
...
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