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

gRPC server enhancements #296

Merged
merged 50 commits into from
Oct 30, 2023

Conversation

tiram88
Copy link
Collaborator

@tiram88 tiram88 commented Oct 20, 2023

Enhance the gRPC server with:

  • Connections (clients) identified with Uuids, allowing multiple connections from the same origin.
  • Handling of concurrent requests and subscriptions. However, in order to preserve the behavior existing in golang version, requests of a given connection and method are still processed in queue.
  • Cleanly shuts down services from core and async runtime.
  • Fix integration tests not shutting down the gRPC server correctly.
  • Add an extra safeguard forcing the gRPC server shutdown on timeout.

@tiram88 tiram88 marked this pull request as ready for review October 24, 2023 15:30
@michaelsutton michaelsutton merged commit acadd87 into kaspanet:master Oct 30, 2023
smartgoo pushed a commit to smartgoo/rusty-kaspa that referenced this pull request Jun 18, 2024
* Identify connections to gRPC server with Uuids

* Add concurrent request and subscription handlers to the connection to the gRPC server

* On shutdown clear services from core and async runtime

* Use tonic v0.10.x

* Make `Notifier` sync channel available to integration tests

* Fix tokio test runtime in daemon integration tests

* Remove links from Connection & ConnectionHandler to Manager

* Stop gRPC server forcefully on shutdown timeout

* Add a gRPC client-server sanity check test

* Lint

* Reduce sleep time

* Refactor gRPC client-server test

* Add a gRPC client-server notifications test

* Allocate only one thread to tokio test runtime of all daemon integration tests

* Handle legacy virtual hash in `EstimateNetworkHashesPerSecond` RPC method

* Make `subscribe` fn resistant to a theoretical race-condition

* Ignore duplicated subscriptions

* Add notify requests to Scope conversions

* Unify subscription handler logic (one exception)

* Fix meta

* Fix typos

* Add a gRPC payload ops enum

* Replace `RpcApiOps` with `KaspadPayloadOps` in gRPC client

* Replace `RpcApiOps` with `KaspadPayloadOps` in gRPC server

* Add a macro building a gRPC server interface

* Give request handlers payload op specific methods

* Fix doc

* Working GetMetrics method in gRPC client & server

* Remove obsolete `RpcApiOps::Notification`

* Remove `KaspadPayloadOps::is_subscription()`

* Change GetMetrics server time type to u64

* Strictly correlate interface method set to KaspadPayloadOps variant set

* Set gRPC server shutdown timeout to 1 second

* Update tonic, prost & h2 to the latest versions

* Move the connection routing logic inside the request receive loop, saving a lock

* Make gRPC logs more consistent

* Disconnect the client if the outgoing route gets full

* Ignore oneshot send potential error

* Polish logs

* Refactor "not implemented" error building
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