solana
solana copied to clipboard
RPC-SendTransactionService channel: remove Arc-Mutex wrapper
Problem
- The channel between rpc and send-transaction-service is unneccessarily behind a mutex lock
- Crossbeam channels are designed to be used concurrently, no need to hide them behind a lock
Summary of Changes
- Remove mutex lock
- Remove arc wrapper (no longer necessary without mutex)
Fixes #
the mutex is required, so we would be able to drop transactions that are already in process https://github.com/solana-labs/solana/blob/9dca15a5b7a6e0938e45b3249156d84b51832c27/send-transaction-service/src/send_transaction_service.rs#L434-L451
it's possible to drop mutex in send thread and retry thread would be merged
the mutex is required, so we would be able to drop transactions that are already in process
https://github.com/solana-labs/solana/blob/9dca15a5b7a6e0938e45b3249156d84b51832c27/send-transaction-service/src/send_transaction_service.rs#L434-L451
it's possible to drop mutex in send thread and retry thread would be merged
This PR is removing a mutex on the channel from rpc to sts. The lock you're referring to is on the map of transactions in STS (initial sending thread and retry thread), and is not being touched.
Removing the mutex on channel just allows multiple RPC threads to add transactions to the channel concurrently. If duplicates are added by RPC threads, the dups will be dropped in initial receiving as they are currently, the only difference is the RPC thread isn't blocked on inserting into the channel.
ops, sorry looks like I looked at something else :upside_down_face:
This repository is no longer in use. Please re-open this pull request in the agave repo: https://github.com/anza-xyz/agave