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 4 commits 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 78.1%. Comparing base (33e1c42) to head (9bc8719).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5163   +/-   ##
=======================================
  Coverage     78.1%   78.1%           
=======================================
  Files          790     790           
  Lines        67556   67553    -3     
  Branches      8158    8154    -4     
=======================================
+ Hits         52785   52792    +7     
+ Misses       14771   14761   -10     
Files with missing lines Coverage Δ
src/xrpld/net/detail/RPCCall.cpp 94.3% <100.0%> (ø)
src/xrpld/net/detail/RPCSub.cpp 45.5% <ø> (+1.7%) ⬆️

... and 4 files with indirect coverage changes

Impacted file tree graph

Copy link
Collaborator

@godexsoft godexsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @mvadari that the code comments should be removed. Also added a question.

@WietseWind
Copy link
Member Author

@mvadari comments removed.

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.

3 participants