From 5ffa772fd1d01aa934ac6e5003fc7bcb437fd842 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 11 Dec 2025 11:34:00 -0500 Subject: [PATCH] librados: aio_unwatch() delivers ENOTCONN to AioCompletion 94f42b648feea77bd09dc3fdb48e6db2b48c7717 added a new error condition to IoCtx::aio_unwatch() that callers aren't prepared to handle. instead of returning that error directly, report it asynchronously to the AioCompletion Signed-off-by: Casey Bodley --- src/librados/IoCtxImpl.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/librados/IoCtxImpl.cc b/src/librados/IoCtxImpl.cc index 410f18820ac..dbdcada5fd2 100644 --- a/src/librados/IoCtxImpl.cc +++ b/src/librados/IoCtxImpl.cc @@ -1786,7 +1786,15 @@ int librados::IoCtxImpl::aio_unwatch(uint64_t cookie, AioCompletionImpl *c) c->io = this; boost::intrusive_ptr linger_op = objecter->linger_by_cookie(cookie); if (!linger_op) { - return -ENOTCONN; + // reject invalid cookies with ENOTCONN, but deliver to the + // AioCompletion instead of returning directly + c->rval = -ENOTCONN; + c->complete = true; + if (c->callback_complete || c->callback_safe) { + boost::asio::defer(client->finish_strand, CB_AioComplete(c)); + } + + return 0; } Context *oncomplete = new C_aio_linger_Complete(c, linger_op, true); -- 2.47.3