代码拉取完成,页面将自动刷新
同步操作将从 whoisxxx/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1245ae05c6e2ca7a2af055f9c44f19a0db2971a5 Mon Sep 17 00:00:00 2001
From: yangbin <robin.yb@huawei.com>
Date: Thu, 15 Aug 2019 15:24:03 +0800
Subject: [PATCH 3/3] systemd-core: Close and free dbus when bus authenticating
timedout
1. when timedout happened on authenticating a private dbus(can be established by systemctl command),
this dbus will never be freed and closed, and will left on systemd permanently even through the client
(for example, systemctl command) has closed the connection. This is because when timedout happend,
the event and also the timer to watch dbus actions is disabled by sd_event_source_set_enabled
from source_dispatch function, and systemd can do nothing on it since this dbus will not be activated again.
2. If a private dbus staying on authenticating state, and when systemd sends a signal message, it will also
add this message to the message write queue of this bus and will never send it out because the dbus is not in running.
systemd does this for it believe that the bus will change from authenticating to running sometime, but actually it will not.
3. When many private dbuses are left as authenticating and many signal messages are sent from dbus, it will eat up our memory
to hold these dbuses and messages, and memory usage of systemd will grow very fast.
4. This patch fix this problem by closing and freeing the dbus when authenticating timedout.
---
src/libsystemd/sd-bus/sd-bus.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 05cb4c3..65cf449 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -2946,6 +2946,11 @@ static int bus_process_internal(sd_bus *bus, bool hint_priority, int64_t priorit
if (IN_SET(r, -ENOTCONN, -ECONNRESET, -EPIPE, -ESHUTDOWN)) {
bus_enter_closing(bus);
r = 1;
+ } else if(r == -ETIMEDOUT && !bus->is_system) {
+ /*close dbus directly when timedout happened and it is a private dbus*/
+ log_info("Private bus is closed due authentication timedout.");
+ bus_enter_closing(bus);
+ r = 1;
} else if (r < 0)
return r;
--
2.17.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。