From ba87ae8109abe1616d3e60028cb6f02784b1142a 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 4b4d8046e..05f808f4e 100644 --- a/lib/remote/apilistener.cpp +++ b/lib/remote/apilistener.cpp @@ -708,12 +708,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