mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
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.
This commit is contained in:
parent
89f193fac8
commit
e11544a830
@ -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;
|
||||
}
|
||||
|
@ -897,7 +897,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;
|
||||
}
|
||||
|
@ -687,7 +687,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");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user