Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
80a3ee34
Commit
80a3ee34
authored
Apr 27, 2017
by
David Johnson
Browse files
Make sure vnodePollCleanup is called if it exists.
(And fix it up for Docker...)
parent
fd60aa4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
clientside/tmcc/common/mkvnode.pl
View file @
80a3ee34
...
...
@@ -1067,6 +1067,11 @@ sub CleanupVM()
}
}
# If we might have been polling, make sure that is cleaned up.
if
(
hasLibOp
("
vnodePollCleanup
"))
{
safeLibOp
("
vnodePollCleanup
",
1
,
0
);
}
# if not halted, try that first
my
(
$ret
,
$err
)
=
safeLibOp
('
vnodeState
',
1
,
0
);
if
(
$err
)
{
...
...
clientside/tmcc/linux/docker/libvnode_docker.pm
View file @
80a3ee34
...
...
@@ -2649,12 +2649,13 @@ sub vnodePoll($$$$$$)
"
--data-urlencode 'filters=
\
{
\"
type
\"
:
\
[
\"
container
\"\
],
"
.
"
\"
container
\"
:
\
[
\"
${vnode_id}
\"\
]
\
}'
"
.
"
-G http:/events
";
open
(
$private
->
{
DOCKER_EVENT_FD
},"
$ccmd
|
");
if
(
$?
)
{
my
$pid
=
open
(
$private
->
{
DOCKER_EVENT_FD
},"
$ccmd
|
");
if
(
!
defined
(
$pid
)
||
$?
)
{
warn
("
could not open docker socket for event stream for
$vnode_id
");
delete
(
$private
->
{
DOCKER_EVENT_HISTORY
});
return
-
1
;
}
$private
->
{
DOCKER_EVENT_CHILD
}
=
$pid
;
$private
->
{
DOCKER_EVENT_FD
}
->
autoflush
(
1
);
my
$oldfh
=
select
(
$private
->
{
DOCKER_EVENT_FD
});
$|
=
1
;
...
...
@@ -2677,6 +2678,8 @@ sub vnodePoll($$$$$$)
TBDebugTimeStamp
("
lost docker event stream connection;
"
.
"
reconnecting...
");
delete
(
$private
->
{
DOCKER_EVENT_FD
});
kill
('
KILL
',
$private
->
{
DOCKER_EVENT_CHILD
});
delete
(
$private
->
{
DOCKER_EVENT_CHILD
});
goto
reconnect
;
}
}
...
...
@@ -2749,9 +2752,11 @@ sub vnodePollCleanup($$$$)
my
(
$vnode_id
,
$vmid
,
$vnconfig
,
$private
)
=
@_
;
if
(
exists
(
$private
->
{
DOCKER_EVENT_FD
}))
{
kill
('
KILL
',
$private
->
{
DOCKER_EVENT_CHILD
});
if
(
$private
->
{
DOCKER_EVENT_FD
}
->
opened
())
{
close
(
$private
->
{
DOCKER_EVENT_FD
});
}
delete
(
$private
->
{
DOCKER_EVENT_CHILD
});
delete
(
$private
->
{
DOCKER_EVENT_FD
});
}
if
(
exists
(
$private
->
{
DOCKER_EVENT_HISTORY
}))
{
...
...
Write
Preview
Supports
Markdown
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