From 7abe8d7df51680670ab0e2bc9d5d75bfe3c5c5c6 Mon Sep 17 00:00:00 2001 From: leeguooooo Date: Thu, 11 Jun 2026 18:53:00 +0900 Subject: [PATCH] fix: don't panic RedisCache actor when result receiver is dropped If the caller of CachePoW/RetrivePoW/CacheResult/VerifyCaptchaResult drops the oneshot receiver before the Redis operation completes (e.g. the HTTP client disconnects mid-request), tx.send() fails and the unwrap() panics inside the actor context. The actor dies and every subsequent captcha verification on that instance fails with "Actor mailbox error" until the process is restarted. Ignore the send result instead, matching the existing idiom in master/embedded/master.rs (RemoveCaptcha handler). --- src/cache/redis.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cache/redis.rs b/src/cache/redis.rs index 59f2a01..ac72457 100644 --- a/src/cache/redis.rs +++ b/src/cache/redis.rs @@ -57,7 +57,7 @@ impl Handler for RedisCache { }; let res = con.add_challenge(&msg.key, &payload).await; - tx.send(res).unwrap(); + let _ = tx.send(res); } .into_actor(self); ctx.wait(fut); @@ -86,7 +86,7 @@ impl Handler for RedisCache { } }; - tx.send(r).unwrap(); + let _ = tx.send(r); } .into_actor(self); ctx.wait(fut); @@ -103,7 +103,7 @@ impl Handler for RedisCache { let con = self.0.get_client(); let fut = async move { let r = con.add_token(&msg).await; - tx.send(r).unwrap(); + let _ = tx.send(r); } .into_actor(self); ctx.wait(fut); @@ -120,7 +120,7 @@ impl Handler for RedisCache { let con = self.0.get_client(); let fut = async move { let r = con.get_token(&msg).await; - tx.send(r).unwrap(); + let _ = tx.send(r); } .into_actor(self); ctx.wait(fut);