Skip to contentSkip to conversation

4.5 git: regression in xen systemd shutdown hangs the OS

Xen-users Ian Campbell 4 participants 11 messages Dec 2, 2014 – Dec 9, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 948996368.3219599.1417477301121.JavaMail.yahoo@jws10637.mail.bf1.yahoo.com

#1 lore raw
Quoted 1 line · Mark Pryor

list,

Thanks. If you've identified a buggy changeset then it is fine to post to the devel lists. I've added a CC. I've also CCd everyone listed in the commit which you've fingered.

Olaf, does this suggested change look correct? If so then can you turn it into a patch please.

Quoted 35 lines

this commit to 4.5:

git show 4542ae340d75bd6319e3fcd94e6c9336e210aeef

^^ causes my C7 install to hang at shutdown. xenstored.service will shutdown in parallel with xendomains before it
should
and its broken

its by Olaf
I took the time to narrow the commit down exactly.. first time I ever did that
Its a regression. The xen shutdown process in systemd was OK before that commit

xenconsoled.service needs
After=xenstored.service

not,
After=xenstored.socket

regards,

_______________________________________________
Xen-users mailing list
[email protected]
http://lists.xen.org/xen-users

#2 lore raw
Quoted 9 lines · Ian Campbell
Quoted 1 line · Mark Pryor

list,

Thanks. If you've identified a buggy changeset then it is fine to post to the devel lists. I've added a CC. I've also CCd everyone listed in the commit which you've fingered.

Olaf, does this suggested change look correct? If so then can you turn it into a patch please.

Yes, something like this (sed -i 's@socket@service@g' *.in):

tools/hotplug/Linux/systemd/xen-init-dom0.service.in +2 -2
index 4d4cb23..3befadc 100644
@@ -1,7 +1,7 @@
 [Unit]
 Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
-Requires=xenstored.socket proc-xen.mount
-After=xenstored.socket proc-xen.mount
+Requires=xenstored.service proc-xen.mount
+After=xenstored.service proc-xen.mount
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in +2 -2
index 6b9c96e..0a5807a 100644
@@ -1,7 +1,7 @@
 [Unit]
 Description=qemu for xen dom0 disk backend
-Requires=proc-xen.mount xenstored.socket
-After=proc-xen.mount xenstored.socket xenconsoled.service
+Requires=proc-xen.mount xenstored.service
+After=proc-xen.mount xenstored.service xenconsoled.service
 Before=xendomains.service libvirtd.service libvirt-guests.service
 RefuseManualStop=true
 ConditionPathExists=/proc/xen/capabilities
tools/hotplug/Linux/systemd/xenconsoled.service.in +2 -2
index 2c5d99f..cb44cd6 100644
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xenconsoled - handles logging from guest consoles and hypervisor
-Requires=proc-xen.mount xenstored.socket
-After=proc-xen.mount xenstored.socket
+Requires=proc-xen.mount xenstored.service
+After=proc-xen.mount xenstored.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
tools/hotplug/Linux/systemd/xendomains.service.in +2 -2
index 757278f..9962671 100644
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xendomains - start and stop guests on boot and shutdown
-Requires=proc-xen.mount xenstored.socket
-After=proc-xen.mount xenstored.socket xenconsoled.service xen-init-dom0.service
+Requires=proc-xen.mount xenstored.service
+After=proc-xen.mount xenstored.service xenconsoled.service xen-init-dom0.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]

Olaf

#3 lore raw
Quoted 5 lines · Olaf Hering
Quoted 3 lines · Ian Campbell
Quoted 1 line · Mark Pryor

list,

Quoted 8 lines
Quoted 6 lines

Thanks. If you've identified a buggy changeset then it is fine to post to the devel lists. I've added a CC. I've also CCd everyone listed in the commit which you've fingered.

Olaf, does this suggested change look correct? If so then can you turn it into a patch please.

Yes, something like this (sed -i 's@socket@service@g' *.in):

Can you submit to -devel with a commit log and S-o-b etc please.

Quoted 65 lines
tools/hotplug/Linux/systemd/xen-init-dom0.service.in +2 -2
index 4d4cb23..3befadc 100644
@@ -1,7 +1,7 @@
 [Unit]
 Description=xen-init-dom0, initialise Dom0 configuration (xenstore nodes, JSON configuration stub)
-Requires=xenstored.socket proc-xen.mount
-After=xenstored.socket proc-xen.mount
+Requires=xenstored.service proc-xen.mount
+After=xenstored.service proc-xen.mount
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
tools/hotplug/Linux/systemd/xen-qemu-dom0-disk-backend.service.in +2 -2
index 6b9c96e..0a5807a 100644
@@ -1,7 +1,7 @@
 [Unit]
 Description=qemu for xen dom0 disk backend
-Requires=proc-xen.mount xenstored.socket
-After=proc-xen.mount xenstored.socket xenconsoled.service
+Requires=proc-xen.mount xenstored.service
+After=proc-xen.mount xenstored.service xenconsoled.service
 Before=xendomains.service libvirtd.service libvirt-guests.service
 RefuseManualStop=true
 ConditionPathExists=/proc/xen/capabilities
tools/hotplug/Linux/systemd/xenconsoled.service.in +2 -2
index 2c5d99f..cb44cd6 100644
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xenconsoled - handles logging from guest consoles and hypervisor
-Requires=proc-xen.mount xenstored.socket
-After=proc-xen.mount xenstored.socket
+Requires=proc-xen.mount xenstored.service
+After=proc-xen.mount xenstored.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]
tools/hotplug/Linux/systemd/xendomains.service.in +2 -2
index 757278f..9962671 100644
@@ -1,7 +1,7 @@
 [Unit]
 Description=Xendomains - start and stop guests on boot and shutdown
-Requires=proc-xen.mount xenstored.socket
-After=proc-xen.mount xenstored.socket xenconsoled.service xen-init-dom0.service
+Requires=proc-xen.mount xenstored.service
+After=proc-xen.mount xenstored.service xenconsoled.service xen-init-dom0.service
 ConditionPathExists=/proc/xen/capabilities
 
 [Service]

Olaf

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 10 lines · Ian Campbell
Quoted 9 lines · Olaf Hering
Quoted 7 lines · Ian Campbell
Quoted 1 line · Mark Pryor

list,

Thanks. If you've identified a buggy changeset then it is fine to post to the devel lists. I've added a CC. I've also CCd everyone listed in the commit which you've fingered.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Olaf, does this suggested change look correct? If so then can you turn it into a patch please.

Yes, something like this (sed -i 's@socket@service@g' *.in):

Can you submit to -devel with a commit log and S-o-b etc please.

Yes, I did already. Looks like git send-email does not process a Reported-by tag so Mark did not actually got a copy of that submission. But the actual patch did not change so what I sent him earlier can be used as is.

Olaf

#5 lore raw
In reply to Olaf Hering
Quoted 5 lines · Olaf Hering
Quoted 3 lines · Ian Campbell
Quoted 1 line · Mark Pryor

list,

Quoted 8 lines
Quoted 6 lines

Thanks. If you've identified a buggy changeset then it is fine to post to the devel lists. I've added a CC. I've also CCd everyone listed in the commit which you've fingered.

Olaf, does this suggested change look correct? If so then can you turn it into a patch please.

Yes, something like this (sed -i 's@socket@service@g' *.in):

But even with that change xendomains is hanging if it cant talk to xenstored for whatever reason. The result is that the sytem hangs forever at shutdown.

I will try to fix that for 4.5.

Olaf

#6 lore raw
Quoted 3 lines · Olaf Hering

But even with that change xendomains is hanging if it cant talk to xenstored for whatever reason. The result is that the sytem hangs forever at shutdown.

This looks like a bug in the tools. xl or xenstore-ls hang forever if xenstored disappears. Looks like xs_open() is the culprit. The socket functions fail, then it attempts to use xs_domain_dev() which happens to succeed. Only xenstore-ls has the '-s' option to force operating on a socket. I wonder why libxl does not pass XS_OPEN_SOCKETONLY? It just uses the wrappers for xs_open.

Can xenstored run in another domain?

Olaf

18:02:43.522767 stat("/var/run/xenstored/socket", {st_mode=S_IFSOCK|0600, st_size=0, ...}) = 0 18:02:43.522864 socket(PF_LOCAL, SOCK_STREAM, 0) = 3
18:02:43.522964 fcntl(3, F_GETFD) = 0
18:02:43.523035 fcntl(3, F_SETFD, FD_CLOEXEC) = 0
18:02:43.523117 connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/xenstored/socket"}, 110) = -1 ECONNREFUSED (Connection refused)
18:02:43.523224 close(3) = 0
18:02:43.523305 stat("/proc/xen/xenbus", {st_mode=S_IFREG|0400, st_size=0, ...}) = 0
18:02:43.523393 open("/proc/xen/xenbus", O_RDWR) = 3
18:02:43.523562 brk(0) = 0x250c000
18:02:43.523638 brk(0x252d000) = 0x252d000
18:02:43.523748 rt_sigaction(SIGPIPE, {SIG_IGN, [], SA_RESTORER, 0x7fc9518e3200}, {SIG_DFL, [], 0}, 8) = 0 18:02:43.523834 write(3, "\1\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0", 16) = 16
18:02:43.523938 write(3, "/\0", 2

#7 lore raw
Quoted 6 lines · Olaf Hering
Quoted 3 lines · Olaf Hering

But even with that change xendomains is hanging if it cant talk to xenstored for whatever reason. The result is that the sytem hangs forever at shutdown.

Quoted 8 lines

This looks like a bug in the tools. xl or xenstore-ls hang forever if xenstored disappears. Looks like xs_open() is the culprit. The socket functions fail, then it attempts to use xs_domain_dev() which happens to succeed. Only xenstore-ls has the '-s' option to force operating on a socket. I wonder why libxl does not pass XS_OPEN_SOCKETONLY? It just uses the wrappers for xs_open.

Can xenstored run in another domain?

I think we have xenstored stubdom in tree, don't we?

Quoted 15 lines

Olaf

18:02:43.522767 stat("/var/run/xenstored/socket", {st_mode=S_IFSOCK|0600, st_size=0, ...}) = 0 18:02:43.522864 socket(PF_LOCAL, SOCK_STREAM, 0) = 3
18:02:43.522964 fcntl(3, F_GETFD) = 0
18:02:43.523035 fcntl(3, F_SETFD, FD_CLOEXEC) = 0
18:02:43.523117 connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/xenstored/socket"}, 110) = -1 ECONNREFUSED (Connection refused)
18:02:43.523224 close(3) = 0
18:02:43.523305 stat("/proc/xen/xenbus", {st_mode=S_IFREG|0400, st_size=0, ...}) = 0
18:02:43.523393 open("/proc/xen/xenbus", O_RDWR) = 3
18:02:43.523562 brk(0) = 0x250c000
18:02:43.523638 brk(0x252d000) = 0x252d000
18:02:43.523748 rt_sigaction(SIGPIPE, {SIG_IGN, [], SA_RESTORER, 0x7fc9518e3200}, {SIG_DFL, [], 0}, 8) = 0 18:02:43.523834 write(3, "\1\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0", 16) = 16
18:02:43.523938 write(3, "/\0", 2

#8 lore raw
Quoted 1 line · Wei Liu

I think we have xenstored stubdom in tree, don't we?

If we do, isnt that a "special" setup which does not appear all by its own? If so, shouldnt there be some config file knob to let xs_open use socket only unless told otherwise by the to-be-created knob?

Olaf

#9 lore raw
Quoted 8 lines · Olaf Hering
Quoted 1 line · Wei Liu

I think we have xenstored stubdom in tree, don't we?

If we do, isnt that a "special" setup which does not appear all by its own? If so, shouldnt there be some config file knob to let xs_open use socket only unless told otherwise by the to-be-created knob?

At the very least it needs to run init-xenstore-domain to set it up. I have no idea how this supposes to work though. Maybe other people have better idea.

However I think the problem you're seeing is due to xenstored exits too early, which should be fixable by rearranging the shutdown order? I.e. xenstored shuts down after xendomains.

Wei.

Quoted 1 line

Olaf

#10 lore raw
Quoted 3 lines · Wei Liu

However I think the problem you're seeing is due to xenstored exits too early, which should be fixable by rearranging the shutdown order? I.e. xenstored shuts down after xendomains.

True, and this is addressed by 268b8f1.

Perhaps a crashed or otherwise unavailable xenstored isnt such a problem because its like that since a very long time.

Olaf

#11 lore raw

Olaf Hering writes ("Re: [Xen-devel] [Xen-users] 4.5 git: regression in xen systemd shutdown hangs the OS"):

Quoted 2 lines

Perhaps a crashed or otherwise unavailable xenstored isnt such a problem because its like that since a very long time.

Without xenstored, the system is basically hosed. And it's not really restartable.

Ian.