[systemd-commits] 2 commits - src/manager.c src/unit.c src/unit.h

Lennart Poettering lennart at kemper.freedesktop.org
Fri Jun 4 17:16:49 PDT 2010


 src/manager.c |   15 +++++++++++++--
 src/unit.c    |   14 ++++++--------
 src/unit.h    |    2 +-
 3 files changed, 20 insertions(+), 11 deletions(-)

New commits:
commit dfd8eeed3911ce1a4ffc51b9c444f3f18d545040
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Jun 5 02:16:42 2010 +0200

    unit: bump up default timeout to 60s

diff --git a/src/unit.h b/src/unit.h
index 3a828e6..5e61f7c 100644
--- a/src/unit.h
+++ b/src/unit.h
@@ -40,7 +40,7 @@ typedef enum UnitDependency UnitDependency;
 #include "execute.h"
 
 #define UNIT_NAME_MAX 128
-#define DEFAULT_TIMEOUT_USEC (20*USEC_PER_SEC)
+#define DEFAULT_TIMEOUT_USEC (60*USEC_PER_SEC)
 #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
 
 typedef enum KillMode {
commit 964e0949dd35ecc3fd908de7898b01ab37a13bbb
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Jun 5 02:16:20 2010 +0200

    unit: when destructing units make sure we don't readd the unit to the gc queue after we already removed it there

diff --git a/src/manager.c b/src/manager.c
index e37aa83..3896493 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -543,13 +543,24 @@ static void manager_clear_jobs_and_units(Manager *m) {
 
         assert(m);
 
-        manager_dispatch_cleanup_queue(m);
-
         while ((j = hashmap_first(m->transaction_jobs)))
                 job_free(j);
 
         while ((u = hashmap_first(m->units)))
                 unit_free(u);
+
+        manager_dispatch_cleanup_queue(m);
+
+        assert(!m->load_queue);
+        assert(!m->run_queue);
+        assert(!m->dbus_unit_queue);
+        assert(!m->dbus_job_queue);
+        assert(!m->cleanup_queue);
+        assert(!m->gc_queue);
+
+        assert(hashmap_isempty(m->transaction_jobs));
+        assert(hashmap_isempty(m->jobs));
+        assert(hashmap_isempty(m->units));
 }
 
 void manager_free(Manager *m) {
diff --git a/src/unit.c b/src/unit.c
index 695044a..3bb41a4 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -323,10 +323,15 @@ void unit_free(Unit *u) {
                 if (UNIT_VTABLE(u)->done)
                         UNIT_VTABLE(u)->done(u);
 
-        /* Detach from next 'bigger' objects */
         SET_FOREACH(t, u->meta.names, i)
                 hashmap_remove_value(u->meta.manager->units, t, u);
 
+        if (u->meta.job)
+                job_free(u->meta.job);
+
+        for (d = 0; d < _UNIT_DEPENDENCY_MAX; d++)
+                bidi_set_free(u, u->meta.dependencies[d]);
+
         if (u->meta.type != _UNIT_TYPE_INVALID)
                 LIST_REMOVE(Meta, units_per_type, u->meta.manager->units_per_type[u->meta.type], &u->meta);
 
@@ -344,15 +349,8 @@ void unit_free(Unit *u) {
                 u->meta.manager->n_in_gc_queue--;
         }
 
-        /* Free data and next 'smaller' objects */
-        if (u->meta.job)
-                job_free(u->meta.job);
-
         cgroup_bonding_free_list(u->meta.cgroup_bondings);
 
-        for (d = 0; d < _UNIT_DEPENDENCY_MAX; d++)
-                bidi_set_free(u, u->meta.dependencies[d]);
-
         free(u->meta.description);
         free(u->meta.fragment_path);
 


More information about the systemd-commits mailing list