From fe8d2c50320ee909673923cd7400d31173c4d8cd Mon Sep 17 00:00:00 2001 From: Dmitry Yemanov Date: Tue, 29 Jul 2025 09:46:49 +0300 Subject: [PATCH] Fix crash/hang during shutdown after the attachment was unsuccessfully ping'ed --- src/yvalve/why.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/yvalve/why.cpp b/src/yvalve/why.cpp index 584e91dfe25..6e8885d63b7 100644 --- a/src/yvalve/why.cpp +++ b/src/yvalve/why.cpp @@ -5582,6 +5582,13 @@ isc_db_handle& YAttachment::getHandle() YAttachment::~YAttachment() { + if (handle) + { + // Currently it may be possible after ping() disconnected from the next + fb_assert(!next); + removeHandle(&attachments, handle); + } + if (provider) PluginManagerInterfacePtr()->releasePlugin(provider); } @@ -6035,10 +6042,8 @@ void YAttachment::ping(CheckStatusWrapper* status) if (!savedStatus.getError()) savedStatus.save(status); - StatusVector temp(NULL); - CheckStatusWrapper tempCheckStatusWrapper(&temp); - entry.next()->detach(&tempCheckStatusWrapper); - next = NULL; + entry.next()->release(); + next = nullptr; status_exception::raise(savedStatus.value()); }