Skip to content

Commit

Permalink
geyser: add name to tokio threads (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Dec 23, 2023
1 parent 940c6f2 commit f54a12b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down
2 changes: 1 addition & 1 deletion yellowstone-grpc-geyser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
20 changes: 17 additions & 3 deletions yellowstone-grpc-geyser/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
};
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f54a12b

Please sign in to comment.