Skip to content

Commit

Permalink
geyser: do not disconnect if subscribe stream is closed (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Jun 6, 2023
1 parent 2030b31 commit 9c2b7ea
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
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 @@ -2,7 +2,7 @@
members = [
"examples/rust", # 1.2.0+solana.1.14.17
"yellowstone-grpc-client", # 1.2.0+solana.1.14.17
"yellowstone-grpc-geyser", # 0.8.0+solana.1.14.17
"yellowstone-grpc-geyser", # 0.8.1+solana.1.14.17
"yellowstone-grpc-proto", # 1.2.0+solana.1.14.17
]

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 = "0.8.0+solana.1.14.17"
version = "0.8.1+solana.1.14.17"
authors = ["Triton One"]
edition = "2021"
description = "Yellowstone gRPC Geyser Plugin"
Expand Down
11 changes: 8 additions & 3 deletions yellowstone-grpc-geyser/src/grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ impl GrpcService {
}
ClientMessage::Drop { id } => {
if clients.remove(&id).is_some() {
info!("{id}, client removed");
CONNECTIONS_TOTAL.dec();
}
}
Expand Down Expand Up @@ -692,11 +693,15 @@ impl Geyser for GrpcService {
.await;
}
}
Ok(None) => break,
Err(_error) => break,
Ok(None) => {
break;
}
Err(_error) => {
let _ = new_clients_tx.send(ClientMessage::Drop { id });
break;
}
}
}
let _ = new_clients_tx.send(ClientMessage::Drop { id });
});

Ok(Response::new(ReceiverStream::new(stream_rx)))
Expand Down

0 comments on commit 9c2b7ea

Please sign in to comment.