Skip to content

Commit

Permalink
OS-4897 detect and workaround missed or delayed sysevent messages
Browse files Browse the repository at this point in the history
Reviewed by: Julien Gilli <julien.gilli@joyent.com>
  • Loading branch information
joshwilsdon committed Apr 23, 2016
1 parent 42a3d5f commit 9959c0c
Show file tree
Hide file tree
Showing 5 changed files with 743 additions and 394 deletions.
11 changes: 9 additions & 2 deletions overlay/generic/usr/lib/brand/jcommon/cuninstall
Expand Up @@ -12,7 +12,7 @@
#

#
# Copyright (c) 2014 Joyent, Inc. All rights reserved.
# Copyright (c) 2016 Joyent, Inc. All rights reserved.
#

unset LD_LIBRARY_PATH
Expand Down Expand Up @@ -55,7 +55,14 @@ ORIGIN=`zfs get -H -ovalue origin $PDS_NAME/$bname | grep -v "@final$"`

zfs destroy -rF $PDS_NAME/cores/$bname
zfs destroy -rF $PDS_NAME/$bname
(( $? != 0 )) && (echo "processes in zone: " && fuser $ZONEPATH)
if [[ $? != 0 ]]; then
echo "processes in zone: "
fuser ${ZONEPATH}
# Since we are destroying the zone, we don't want to leave a zoneroot behind
# just because something couldn't be umounted. So we'll also force the
# umount with the 'f' option here.
zfs destroy -rfF $PDS_NAME/$bname
fi

[[ -n ${ORIGIN} && ${ORIGIN} != "-" ]] && zfs destroy -F $ORIGIN

Expand Down
9 changes: 0 additions & 9 deletions overlay/generic/usr/lib/brand/jcommon/statechange
Expand Up @@ -614,14 +614,6 @@ setup_fw()
fi
}

cleanup_stale_socket()
{
SOCKET=$1
if [[ -n $SOCKET && -e $ZONEPATH/root/${SOCKET} ]]; then
rm -f $ZONEPATH/root/${SOCKET}
fi
}

#
# We're readying the zone. Make sure the per-zone writable
# directories exist so that we can lofs mount them. We do this here,
Expand Down Expand Up @@ -858,7 +850,6 @@ if [[ "$subcommand" == "post" && $cmd == 0 ]]; then
[[ -n "$jst_showsnap" ]] && setup_snapshots
setup_net
setup_fw
cleanup_stale_socket "$jst_mdatapath/metadata.sock"
fi
# We can't set a rctl until we have a process in the zone to grab
Expand Down
2 changes: 1 addition & 1 deletion src/node-zsock/src/zsock.c
Expand Up @@ -248,7 +248,7 @@ zsocket(zoneid_t zoneid, const char *path) {
ctid_t ct = -1;
int _errno = 0;
int pid = 0;
int sock_fd = 0;
int sock_fd = -1;
int sockfd[2] = {0};
int stat = 0;
int tmpl_fd = 0;
Expand Down

0 comments on commit 9959c0c

Please sign in to comment.