From f54a12b1195db97cde046a5b4549878f3e760d9f Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Fri, 22 Dec 2023 20:24:02 -0500 Subject: [PATCH] geyser: add name to tokio threads (#267) --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- CHANGELOG.md | 11 +++++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- yellowstone-grpc-geyser/Cargo.toml | 2 +- yellowstone-grpc-geyser/src/plugin.rs | 20 +++++++++++++++++--- 7 files changed, 33 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4aeffda4..7174f2b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: os: [ubuntu-20.04, ubuntu-22.04] runs-on: ["${{ matrix.os }}"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set rust version run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 675bcaf4..e83d1818 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: os: [ubuntu-20.04, ubuntu-22.04] runs-on: ["${{ matrix.os }}"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set rust version run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 12c2d772..2afa6ff0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,17 @@ The minor version will be incremented upon a breaking change and the patch versi ### Breaking +## 2023-12-22 + +- yellowstone-grpc-client-1.12.0+solana.1.17.12 +- yellowstone-grpc-geyser-1.11.2+solana.1.17.12 +- yellowstone-grpc-proto-1.11.1+solana.1.17.12 +- yellowstone-grpc-tools-1.0.0-rc.9+solana.1.17.12 + +### Features + +- geyser: add name to tokio threads ([#267](https://github.com/rpcpool/yellowstone-grpc/pull/267)) + ## 2023-12-19 - yellowstone-grpc-client-1.12.0+solana.1.17.12 diff --git a/Cargo.lock b/Cargo.lock index a18a9ed6..df5b4b43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4995,7 +4995,7 @@ dependencies = [ [[package]] name = "yellowstone-grpc-geyser" -version = "1.11.1+solana.1.17.12" +version = "1.11.2+solana.1.17.12" dependencies = [ "anyhow", "base64 0.21.4", diff --git a/Cargo.toml b/Cargo.toml index 93882acf..10d018f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = [ "examples/rust", # 1.11.0+solana.1.17.12 "yellowstone-grpc-client", # 1.12.0+solana.1.17.12 - "yellowstone-grpc-geyser", # 1.11.1+solana.1.17.12 + "yellowstone-grpc-geyser", # 1.11.2+solana.1.17.12 "yellowstone-grpc-proto", # 1.11.0+solana.1.17.12 "yellowstone-grpc-tools", # 1.0.0-rc.9+solana.1.17.12 ] diff --git a/yellowstone-grpc-geyser/Cargo.toml b/yellowstone-grpc-geyser/Cargo.toml index 72be25ae..0a7e16cf 100644 --- a/yellowstone-grpc-geyser/Cargo.toml +++ b/yellowstone-grpc-geyser/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "yellowstone-grpc-geyser" -version = "1.11.1+solana.1.17.12" +version = "1.11.2+solana.1.17.12" authors = { workspace = true } edition = { workspace = true } description = "Yellowstone gRPC Geyser Plugin" diff --git a/yellowstone-grpc-geyser/src/plugin.rs b/yellowstone-grpc-geyser/src/plugin.rs index 2e3e52d8..d720649e 100644 --- a/yellowstone-grpc-geyser/src/plugin.rs +++ b/yellowstone-grpc-geyser/src/plugin.rs @@ -9,9 +9,15 @@ use { ReplicaEntryInfoVersions, ReplicaTransactionInfoVersions, Result as PluginResult, SlotStatus, }, - std::{sync::Arc, time::Duration}, + std::{ + sync::{ + atomic::{AtomicUsize, Ordering}, + Arc, + }, + time::Duration, + }, tokio::{ - runtime::Runtime, + runtime::{Builder, Runtime}, sync::{mpsc, Notify}, }, }; @@ -60,7 +66,15 @@ impl GeyserPlugin for Plugin { solana_logger::setup_with_default(&config.log.level); // Create inner - let runtime = Runtime::new().map_err(|error| GeyserPluginError::Custom(Box::new(error)))?; + let runtime = Builder::new_multi_thread() + .thread_name_fn(|| { + static ATOMIC_ID: AtomicUsize = AtomicUsize::new(0); + let id = ATOMIC_ID.fetch_add(1, Ordering::Relaxed); + format!("solGeyserGrpc{id:02}") + }) + .enable_all() + .build() + .map_err(|error| GeyserPluginError::Custom(Box::new(error)))?; let (snapshot_channel, grpc_channel, grpc_shutdown, prometheus) = runtime.block_on(async move {