summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-05-04 19:01:56 +0200
committerSven Eden <yamakuzure@gmx.net>2017-06-16 10:12:58 +0200
commit451a2b7a44f3624b15bbf960e338791e0b0a4210 (patch)
treeb9d8eb5ed7fb911a016d3e084e9d6c2dca2e92a1 /src
parent0fa22a24e08416f3ba2278b9780990e67faf6e30 (diff)
logind: process session/inhibitor fds at higher priority
Let's make sure we process session and inhibitor pipe fds (that signal sessions/inhibtors going away) at a higher priority than new bus calls that might create new sessions or inhibitors. This helps ensuring that the number of open sessions stays minimal.
Diffstat (limited to 'src')
-rw-r--r--src/login/logind-inhibit.c2
-rw-r--r--src/login/logind-session.c4
-rw-r--r--src/login/logind.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index a0e3ba2b7..6c78e0ddd 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -317,7 +317,7 @@ int inhibitor_create_fifo(Inhibitor *i) {
if (r < 0)
return r;
- r = sd_event_source_set_priority(i->event_source, SD_EVENT_PRIORITY_IDLE);
+ r = sd_event_source_set_priority(i->event_source, SD_EVENT_PRIORITY_IDLE-10);
if (r < 0)
return r;
}
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 2ed6b2fa3..61d34d1a9 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -962,7 +962,9 @@ int session_create_fifo(Session *s) {
if (r < 0)
return r;
- r = sd_event_source_set_priority(s->fifo_event_source, SD_EVENT_PRIORITY_IDLE);
+ /* Let's make sure we noticed dead sessions before we process new bus requests (which might create new
+ * sessions). */
+ r = sd_event_source_set_priority(s->fifo_event_source, SD_EVENT_PRIORITY_NORMAL-10);
if (r < 0)
return r;
}
diff --git a/src/login/logind.c b/src/login/logind.c
index 83c6d8318..e0cd70448 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -822,7 +822,7 @@ static int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to register name: %m");
- r = sd_bus_attach_event(m->bus, m->event, 0);
+ r = sd_bus_attach_event(m->bus, m->event, SD_EVENT_PRIORITY_NORMAL);
if (r < 0)
return log_error_errno(r, "Failed to attach bus to event loop: %m");