Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RPC Webhook queue dropping #5163

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

WietseWind
Copy link
Member

@WietseWind WietseWind commented Oct 24, 2024

Problem:

When using subscribe at admin RPC port to send webhooks for the transaction stream to a backend, on large(r) ledgers the endpoint was consistently receiving fewer HTTP POSTs with TX information than the amount of transactions in a ledger.

This resulted in some XamanWallet users, on larger ledgers, not always receiving their transaction push notifications.

Details

Admin command RPC Post to URL had a 32 queue length (hardcoded) resulting in dropping TX notifications.

  1. As this is an admin-command only, I stripped out the entire queue length check. If admin, you should know what you are doing. If your endpoint can't efficiently handle the TPS, your problem.

  2. Also: shorter TTL for outgoing RPC HTTP calls: was 10 minutes PER REQUEST, now is 30 seconds (still too long, but 10 minutes is a guaranteed shit show if the calls keep on hanging and stack up, especially since the 32 queue length for HTTP calls is now removed).

While dropping the queue length limit on sent WebHooks could be considered dangerous, it's guarded by admin-RPC port anyway:

if (context.role != Role::ADMIN)

Finally:

  1. Change timeout const to be less ambiguous.

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.4%. Comparing base (1fbf8da) to head (15a7863).
Report is 8 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5163     +/-   ##
=========================================
+ Coverage     76.2%   77.4%   +1.2%     
=========================================
  Files          760     762      +2     
  Lines        61568   64933   +3365     
  Branches      8126    8117      -9     
=========================================
+ Hits         46909   50278   +3369     
+ Misses       14659   14655      -4     
Files with missing lines Coverage Δ
src/xrpld/net/detail/RPCCall.cpp 94.2% <100.0%> (+0.4%) ⬆️
src/xrpld/net/detail/RPCSub.cpp 45.5% <ø> (+3.1%) ⬆️

... and 575 files with indirect coverage changes

Impacted file tree graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant