From f336be2120076728b8190e33a5f86133cf65a9b2 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 15 2015 11:38:38 +0000 Subject: import systemd-208-20.el7_1.6 --- diff --git a/SOURCES/0389-machined-force-machined-to-dispatch-messages.patch b/SOURCES/0389-machined-force-machined-to-dispatch-messages.patch new file mode 100644 index 0000000..8ebbf12 --- /dev/null +++ b/SOURCES/0389-machined-force-machined-to-dispatch-messages.patch @@ -0,0 +1,95 @@ +From 1ed560ffff6753d79f2f1da81447e5f8d3628ec1 Mon Sep 17 00:00:00 2001 +From: Alexander Solganik +Date: Wed, 29 Apr 2015 10:06:40 +0300 +Subject: [PATCH] machined: force machined to dispatch messages + +Fixes https://bugzilla.redhat.com/show_bug.cgi?format=multiple&id=1172387. + +Machined works in the follwing way : + +loop : + 1) perform GC (Note at the end) + 2) read messages from DBUS and dispatch one + 3) if more messages pending goto (1) + 3) perform GC (NOTE at the end) + 4) poll on DBUS fd + 5) goto step 1 + +This works fine, except that in step (3) and (1) +there is a message send/reply receive of + r = bus_method_call_with_reply( + manager->bus, + "org.freedesktop.systemd1", + "/org/freedesktop/systemd1", + "org.freedesktop.systemd1.Manager", + "StopUnit", + &reply, + error, + DBUS_TYPE_STRING, &unit, + DBUS_TYPE_STRING, &fail, + DBUS_TYPE_INVALID); + +which causes network layer to read/write messages to DBUS fd. In case that any +other message gets in during this send/receive cycle it wont be processed till +next stage (2) which will occur only in case that more messages are received +by machined. + +Cherry-picked from: rhel-only +Resolves: #1243401 +--- + src/machine/machined.c | 8 ++++++-- + src/machine/machined.h | 2 +- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/machine/machined.c b/src/machine/machined.c +index ad804a1..531e7ad 100644 +--- a/src/machine/machined.c ++++ b/src/machine/machined.c +@@ -243,20 +243,23 @@ fail: + return r; + } + +-void manager_gc(Manager *m, bool drop_not_started) { ++bool manager_gc(Manager *m, bool drop_not_started) { + Machine *machine; ++ bool dbus_send_receive_performed = false; + + assert(m); + + while ((machine = m->machine_gc_queue)) { + LIST_REMOVE(Machine, gc_queue, m->machine_gc_queue, machine); + machine->in_gc_queue = false; ++ dbus_send_receive_performed = true; + + if (machine_check_gc(machine, drop_not_started) == 0) { + machine_stop(machine); + machine_free(machine); + } + } ++ return dbus_send_receive_performed; + } + + int manager_startup(Manager *m) { +@@ -301,7 +304,8 @@ int manager_run(Manager *m) { + if (dbus_connection_dispatch(m->bus) != DBUS_DISPATCH_COMPLETE) + continue; + +- manager_gc(m, true); ++ if (manager_gc(m, true)) ++ continue; + + n = epoll_wait(m->epoll_fd, &event, 1, -1); + if (n < 0) { +diff --git a/src/machine/machined.h b/src/machine/machined.h +index 780f516..3245e05 100644 +--- a/src/machine/machined.h ++++ b/src/machine/machined.h +@@ -59,7 +59,7 @@ int manager_enumerate_machines(Manager *m); + int manager_startup(Manager *m); + int manager_run(Manager *m); + +-void manager_gc(Manager *m, bool drop_not_started); ++bool manager_gc(Manager *m, bool drop_not_started); + + int manager_get_machine_by_pid(Manager *m, pid_t pid, Machine **machine); + diff --git a/SPECS/systemd.spec b/SPECS/systemd.spec index 3641684..7d2e7c8 100644 --- a/SPECS/systemd.spec +++ b/SPECS/systemd.spec @@ -8,7 +8,7 @@ Name: systemd Url: http://www.freedesktop.org/wiki/Software/systemd Version: 208 -Release: 20%{?dist}.5 +Release: 20%{?dist}.6 # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: A System and Service Manager @@ -416,6 +416,7 @@ Patch0385: 0385-Revert-units-fix-BindsTo-logic-when-applied-relative.patch Patch0386: 0386-run-drop-mistakenly-committed-test-code.patch Patch0387: 0387-cgroup-downgrade-log-messages-when-we-cannot-write-t.patch Patch0388: 0388-rules-load-sg-module.patch +Patch0389: 0389-machined-force-machined-to-dispatch-messages.patch %global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);} @@ -1216,6 +1217,9 @@ getent passwd systemd-journal-gateway >/dev/null 2>&1 || useradd -r -l -u 191 -g %{_datadir}/systemd/gatewayd %changelog +* Thu Jul 16 2015 Lukas Nykryn - 208-20.6 +- machined: force machined to dispatch messages (#1243401) + * Thu May 21 2015 Lukas Nykryn - 208-20.5 - rules: load sg module (#1223340)