From 1343fd538d2cadeccd0a720420468d19e03266a8 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 12 Nov 2020 13:46:47 +0100 Subject: [PATCH] Start ApiListener#SyncClient() in the thread pool ... not hosting the coroutines not to block them. Otherwise a large replay log would block messages sending until the peer disconnects us. --- lib/remote/apilistener.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp index 5f459d4be..0462d728f 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -691,12 +691,9 @@ void ApiListener::NewClientHandlerInternal( if (endpoint) { endpoint->AddClient(aclient); - IoEngine::SpawnCoroutine(IoEngine::Get().GetIoContext(), [this, aclient, endpoint](asio::yield_context yc) { - CpuBoundWork syncClient (yc); - + Utility::QueueAsyncCallback([this, aclient, endpoint]() { SyncClient(aclient, endpoint, true); }); - } else if (!AddAnonymousClient(aclient)) { Log(LogNotice, "ApiListener") << "Ignoring anonymous JSON-RPC connection " << conninfo