]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librados: aio_unwatch() delivers ENOTCONN to AioCompletion
authorCasey Bodley <cbodley@redhat.com>
Thu, 11 Dec 2025 16:34:00 +0000 (11:34 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Dec 2025 16:00:49 +0000 (11:00 -0500)
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 <cbodley@redhat.com>
src/librados/IoCtxImpl.cc

index 410f18820acbcd9bbf771ddf4d3635dca84f80ff..dbdcada5fd2fab885b093794f4bae4dbafadbd7a 100644 (file)
@@ -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);