This is an automated email from the ASF dual-hosted git repository.
yuxia pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fluss-rust.git
The following commit(s) were added to refs/heads/main by this push:
new fd8e9c4 chore: Fix async fn panic in CancellationSafeFuture when
future completes
fd8e9c4 is described below
commit fd8e9c45a27662e4c921ca331082c48d5205145f
Author: yuxia Luo <[email protected]>
AuthorDate: Thu Jan 29 00:04:47 2026 +0800
chore: Fix async fn panic in CancellationSafeFuture when future completes
---
crates/fluss/src/rpc/server_connection.rs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/crates/fluss/src/rpc/server_connection.rs
b/crates/fluss/src/rpc/server_connection.rs
index 7504e2a..c8fe9ae 100644
--- a/crates/fluss/src/rpc/server_connection.rs
+++ b/crates/fluss/src/rpc/server_connection.rs
@@ -385,9 +385,15 @@ where
mut self: std::pin::Pin<&mut Self>,
cx: &mut std::task::Context<'_>,
) -> Poll<Self::Output> {
- match self.inner.as_mut().expect("no dropped").as_mut().poll(cx) {
+ let inner = self
+ .inner
+ .as_mut()
+ .expect("CancellationSafeFuture polled after completion");
+
+ match inner.as_mut().poll(cx) {
Poll::Ready(res) => {
self.done = true;
+ self.inner = None; // Prevent re-polling
Poll::Ready(res)
}
Poll::Pending => Poll::Pending,