[DragonFlyBSD - Bug #3434] (Resolved) hammer2: reconnect can hang on a quiet connection
liweitianux
bugtracker-admin at leaf.dragonflybsd.org
Mon Oct 5 06:39:55 PDT 2026
Issue #3434 has been updated by liweitianux.
Status changed from New to Resolved
Patch merged. Thank you.
----------------------------------------
Bug #3434: hammer2: reconnect can hang on a quiet connection
http://bugs.dragonflybsd.org/issues/3434#change-14791
* Author: sigttou
* Status: Resolved
* Priority: Normal
* Category: Kernel
* Target version: 6.6
* Start date: 2026-10-04
----------------------------------------
A hammer2 recluster ioctl can wait forever when the old connection is
still open but sends no data. The ioctl holds the filesystem's root vnode
while it waits, so file opens, writes and unmount can also block.
`kdmsg_iocom_reconnect()` sets `KILLRX` and wakes `msg_ctl`, then waits for
the reader and writer threads to exit. The reader may already be blocked
in `fp_read()` on the old connection. Waking `msg_ctl` does not interrupt
that read, so the threads cannot finish shutting down.
The wait also releases `msglk`. Another reconnect can then replace the
connection and start new threads. Shutting down the old connection only
once can leave a waiting caller blocked on those replacement threads.
Fix:
Call `fp_shutdown(iocom->msg_fp, SHUT_RDWR)` inside the worker-wait loop,
when `msg_fp` is not null. This unblocks reads and writes on the connection.
Repeating it in the loop also handles a connection replaced by another
reconnect while the caller waits.
---Files--------------------------------
0001-kdmsg-unblock-reconnect-workers.patch (1.58 KB)
--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account
More information about the Bugs
mailing list