sysmaster/backport-fix-set-the-notify-socket-receive-buffer-to-8M.patch
huyubiao 8936fa02c5 sync patches from upstream,change the path of the unit,modify permissions for some directories and files
(cherry picked from commit ce9ff469b57f60130621bc293783bd3ac1fc92f2)
2023-08-05 18:15:53 +08:00

36 lines
1.2 KiB
Diff

From d41a6113c8c109d3436a0de0329984ebec522da5 Mon Sep 17 00:00:00 2001
From: licunlong <licunlong1@huawei.com>
Date: Tue, 11 Jul 2023 17:05:25 +0800
Subject: [PATCH] fix: set the notify socket receive buffer to 8M
---
core/sysmaster/unit/notify.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/core/sysmaster/unit/notify.rs b/core/sysmaster/unit/notify.rs
index 4f92b63..f35ed91 100644
--- a/core/sysmaster/unit/notify.rs
+++ b/core/sysmaster/unit/notify.rs
@@ -14,7 +14,7 @@ use super::datastore::UnitDb;
use super::entry::UnitX;
use super::rentry::UnitRe;
use crate::job::JobManager;
-use basic::fd_util;
+use basic::{fd_util, socket_util};
use event::{EventState, EventType, Events, Source};
use nix::cmsg_space;
use nix::errno::Errno;
@@ -181,6 +181,9 @@ impl Notify {
return Err(e);
}
socket::setsockopt(fd, sockopt::PassCred, &true)?;
+ if let Err(e) = socket_util::set_receive_buffer(fd, 1024 * 1014 * 8) {
+ log::error!("Failed to set the notify socket receive buffer: {e}");
+ }
log::debug!("set event fd is: {}", fd);
self.reli.fd_cloexec(fd, false)?;
--
2.33.0