Fix: admin RPC webhook queue limit removal and timeout reduction (#5163)

When using subscribe at admin RPC port to send webhooks for the transaction stream to a backend, on large(r) ledgers the endpoint receives fewer HTTP POSTs with TX information than the amount of transactions in a ledger. This change removes the hardcoded queue length to avoid dropping TX notifications for the admin-only command. In addition, the per-request TTL for outgoing RPC HTTP calls has been reduced from 10 minutes to 30 seconds.
This commit is contained in:
Wietse Wind
2025-04-10 08:37:24 +02:00
committed by tequ
parent 3175501e84
commit 9163f342be
2 changed files with 2 additions and 16 deletions

View File

@@ -1884,9 +1884,7 @@ fromNetwork(
constexpr auto RPC_REPLY_MAX_BYTES = megabytes(256);
using namespace std::chrono_literals;
// auto constexpr RPC_NOTIFY = 10min; // Wietse: lolwut 10 minutes for one
// HTTP call?
auto constexpr RPC_NOTIFY = 30s;
auto constexpr RPC_WEBHOOK_TIMEOUT = 30s;
HTTPClient::request(
bSSL,
@@ -1903,7 +1901,7 @@ fromNetwork(
std::placeholders::_2,
j),
RPC_REPLY_MAX_BYTES,
RPC_NOTIFY,
RPC_WEBHOOK_TIMEOUT,
std::bind(
&RPCCallImp::onResponse,
callbackFuncP,

View File

@@ -80,15 +80,6 @@ public:
{
std::lock_guard sl(mLock);
// Wietse: we're not going to limit this, this is admin-port only, scale
// accordingly Dropping events just like this results in inconsistent
// data on the receiving end if (mDeque.size() >= eventQueueMax)
// {
// // Drop the previous event.
// JLOG(j_.warn()) << "RPCCall::fromNetwork drop";
// mDeque.pop_back();
// }
auto jm = broadcast ? j_.debug() : j_.info();
JLOG(jm) << "RPCCall::fromNetwork push: " << jvObj;
@@ -186,9 +177,6 @@ private:
}
private:
// Wietse: we're not going to limit this, this is admin-port only, scale
// accordingly enum { eventQueueMax = 32 };
boost::asio::io_service& m_io_service;
JobQueue& m_jobQueue;