Commit 6c073082 authored by Lennart Poettering's avatar Lennart Poettering
Browse files

socket: disable GC for pre-allocated per-connection service until it is used

parent 4927fcae
......@@ -165,6 +165,7 @@ static int socket_instantiate_service(Socket *s) {
if (r < 0)
return r;
u->meta.no_gc = true;
s->service = SERVICE(u);
return 0;
}
......@@ -1202,6 +1203,8 @@ static void socket_enter_running(Socket *s, int cfd) {
s->service = NULL;
s->n_accepted ++;
service->meta.no_gc = false;
unit_choose_id(UNIT(service), name);
free(name);
......
......@@ -236,6 +236,9 @@ bool unit_check_gc(Unit *u) {
if (UNIT_VTABLE(u)->no_gc)
return true;
if (u->meta.no_gc)
return true;
if (u->meta.job)
return true;
......
......@@ -208,6 +208,8 @@ struct Meta {
bool in_gc_queue:1;
bool sent_dbus_new_signal:1;
bool no_gc:1;
};
#include "service.h"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment