fix(rpc): abort in-flight curl on disconnect/shutdown to avoid UI freezes
stop()-ing a worker that is mid curl_easy_perform joined on the UI thread, so a slow/hung transfer froze the UI until the request timeout. Add RPCClient:: requestAbort() (a thread-safe atomic read by a curl progress callback that aborts the transfer), and call it before stopping the workers on disconnect (onDisconnected) and shutdown (beginShutdown + the synchronous fallback). The flag is cleared on each connect() so a fresh connection never starts aborted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -507,7 +507,9 @@ void App::onDisconnected(const std::string& reason)
|
||||
address_validation_cache_dirty_ = true;
|
||||
resetTransactionHistoryCacheSession();
|
||||
|
||||
// Tear down the fast-lane connection
|
||||
// Tear down the fast-lane connection. Signal abort first so a fast-lane call blocked in
|
||||
// curl_easy_perform unblocks and stop()'s join() returns promptly (no UI freeze).
|
||||
if (fast_rpc_) fast_rpc_->requestAbort();
|
||||
if (fast_worker_) {
|
||||
fast_worker_->stop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user