Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ The minor version will be incremented upon a breaking change and the patch versi

### Breaking

## 2025-06-10

- yellowstone-grpc-geyser-4.2.3

### Fixes

- geyser: log gRPC server panics ([#515](https://github.com/rpcpool/yellowstone-grpc/pull/519))

## 2025-06-01

- @triton-one/[email protected]
Expand Down
16 changes: 14 additions & 2 deletions yellowstone-grpc-geyser/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,18 @@ impl GrpcService {
let shutdown = Arc::new(Notify::new());
let shutdown_grpc = Arc::clone(&shutdown);
tokio::spawn(async move {
// Add low-overhead panic hook without affecting any hooks added by Solana.
let old_hook = std::panic::take_hook();
std::panic::set_hook(Box::new(move |panic_info| {
error!("gRPC server task panicked: {:?}", panic_info);
old_hook(panic_info); // Chain to the previous hook
}));

// gRPC Health check service
let (mut health_reporter, health_service) = health_reporter();
health_reporter.set_serving::<GeyserServer<Self>>().await;

server_builder
let result = server_builder
.layer(interceptor(move |request: Request<()>| {
if let Some(x_token) = &config.x_token {
match request.metadata().get("x-token") {
Expand All @@ -500,7 +507,12 @@ impl GrpcService {
.add_service(health_service)
.add_service(service)
.serve_with_incoming_shutdown(incoming, shutdown_grpc.notified())
.await
.await;

match result {
Ok(_) => info!("gRPC server task finished"),
Err(e) => error!("gRPC server task failed: {e}"),
}
});

Ok((snapshot_tx, messages_tx, shutdown))
Expand Down
Loading