Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

rpc-sts: respect app exit in tx receiver thread #27404

Merged
merged 1 commit into from
Aug 26, 2022
Merged
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
6 changes: 5 additions & 1 deletion send-transaction-service/src/send_transaction_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,11 @@ impl SendTransactionService {
.spawn(move || loop {
let recv_timeout_ms = config.batch_send_rate_ms;
let stats = &stats_report.stats;
match receiver.recv_timeout(Duration::from_millis(recv_timeout_ms)) {
let recv_result = receiver.recv_timeout(Duration::from_millis(recv_timeout_ms));
if exit.load(Ordering::Relaxed) {
break;
}
match recv_result {
Err(RecvTimeoutError::Disconnected) => {
info!("Terminating send-transaction-service.");
exit.store(true, Ordering::Relaxed);
Expand Down