sbudplus: Release queue_eventfd to prevent double close
Tested: Not hitting this error anymore.
```
Assertion 'close_nointr(fd) != -EBADF' failed at c/debug/systemd/256.7/src/basic/fd-util.c:75, function safe_close(). Aborting.
```
Fusion-Link: fusion2 N/A
Google-Bug-Id: 440638562
Change-Id: Ia7c8c34d9779160419b454a85c2ee1fdd18a0021
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/recipes-extended/sdbusplus/sdbusplus/0001-asio-Leverage-sd-bus-rqueue-eventfd.patch b/recipes-extended/sdbusplus/sdbusplus/0001-asio-Leverage-sd-bus-rqueue-eventfd.patch
index 779bd62..a12a96b 100644
--- a/recipes-extended/sdbusplus/sdbusplus/0001-asio-Leverage-sd-bus-rqueue-eventfd.patch
+++ b/recipes-extended/sdbusplus/sdbusplus/0001-asio-Leverage-sd-bus-rqueue-eventfd.patch
@@ -1,18 +1,20 @@
-From db591c7cdf815ce5141d47b4fc42ee624f433c8c Mon Sep 17 00:00:00 2001
+From 18a4b95dcef9433aadfd976315694d6ee397859f Mon Sep 17 00:00:00 2001
From: "William A. Kennington III" <wak@google.com>
Date: Wed, 20 Aug 2025 11:08:31 -0700
-Subject: [PATCH 1/2] asio: Leverage sd-bus rqueue eventfd
+Subject: [PATCH] asio: Leverage sd-bus rqueue eventfd
+Change-Id: I866e7ee31aef2673ca26880b7f32f1b66caf58c2
Signed-off-by: William A. Kennington III <wak@google.com>
+Signed-off-by: Willy Tu <wltu@google.com>
---
- include/sdbusplus/asio/connection.hpp | 39 ++++++++++++++++++++++++---
+ include/sdbusplus/asio/connection.hpp | 40 +++++++++++++++++++++++++--
include/sdbusplus/bus.hpp | 4 +++
- include/sdbusplus/sdbus.hpp | 6 +++++
+ include/sdbusplus/sdbus.hpp | 6 ++++
include/sdbusplus/test/sdbus_mock.hpp | 1 +
- 4 files changed, 47 insertions(+), 3 deletions(-)
+ 4 files changed, 48 insertions(+), 3 deletions(-)
diff --git a/include/sdbusplus/asio/connection.hpp b/include/sdbusplus/asio/connection.hpp
-index 841c6d7..ff1b608 100644
+index 841c6d7..b5021c1 100644
--- a/include/sdbusplus/asio/connection.hpp
+++ b/include/sdbusplus/asio/connection.hpp
@@ -54,14 +54,18 @@ class connection : public sdbusplus::bus_t
@@ -36,7 +38,15 @@
}
~connection()
{
-@@ -313,7 +317,7 @@ class connection : public sdbusplus::bus_t
+@@ -69,6 +73,7 @@ class connection : public sdbusplus::bus_t
+ // sd_bus object to avoid a double close() Ignore return codes here,
+ // because there's nothing we can do about errors
+ socket.release();
++ queue_eventfd.release();
+ }
+
+ /** @brief Perform an asynchronous send of a message, executing the handler
+@@ -313,7 +318,7 @@ class connection : public sdbusplus::bus_t
private:
boost::asio::io_context& io_;
@@ -45,7 +55,7 @@
void read_wait()
{
-@@ -347,6 +351,35 @@ class connection : public sdbusplus::bus_t
+@@ -347,6 +352,35 @@ class connection : public sdbusplus::bus_t
}
});
}
@@ -133,5 +143,5 @@
(override));
--
-2.51.0.rc1.193.gad69d77794-goog
+2.51.0.261.g7ce5a0a67e-goog