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 grpc reconnection and add /info endpoint #18

Merged
merged 4 commits into from
Mar 22, 2024

Conversation

matheusd
Copy link
Member

The /info endpoint is meant to offer information about the server's management of the channels to the operator. It should only be accessible from localhost.

This also fixes the gRPC connection issue #17.

This will enable querying the server for this information without having
to also decode it somewhere else.
This returns information about the managed channels.
Only accesses from localhost (considering reverse-proxied requests) are
allowed.
This fixes the server's Run method to properly attempt reconnections to
the dcrlnd node in case of errors.

Previously, two things were wrong in this method:

- The context used in some calls was ctx instead of gctx, which caused
  some of the subsystems to not exit correctly on failures and thus mask
  the underlying connection error.
- There was no re-attempt at failed operations, when the reason for
  failure was a connection error (as opposed to a graceful termination
  of the server).

This commit fixes both issues by using the correct context everywhere
and ensuring all subsystems re-attempt their functions until the context
is canceled, with an appropriate delay.
@dajohi dajohi merged commit 1a0d1a9 into decred:master Mar 22, 2024
2 checks passed
@matheusd matheusd deleted the fix-grpc-conn branch March 22, 2024 14:46
@matheusd matheusd restored the fix-grpc-conn branch March 22, 2024 14:46
@matheusd matheusd deleted the fix-grpc-conn branch March 22, 2024 14:46
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.

2 participants