Buggy code:
public class StorageProxy implements StorageProxyMBean { public static final String MBEAN_NAME = "org.apache.cassandra.db:type=StorageProxy" ; private static final Logger logger = LoggerFactory . getLogger ( StorageProxy . class ) ; static final boolean OPTIMIZE_LOCAL_REQUESTS = true ; public static final String UNREACHABLE = "UNREACHABLE" ; private static final StorageProxy . WritePerformer standardWritePerformer ; private static final StorageProxy . WritePerformer counterWritePerformer ; private static final StorageProxy . WritePerformer counterWriteOnCoordinatorPerformer ; public static final StorageProxy instance = new StorageProxy ( ) ; private static volatile int maxHintsInProgress = 128 * ( FBUtilities . getAvailableProcessors ( ) ) ; private static final CacheLoader < InetAddress , AtomicInteger > hintsInProgress = new CacheLoader < InetAddress , AtomicInteger > ( ) { public AtomicInteger load ( InetAddress inetAddress ) { } } ; private static final ClientRequestMetrics readMetrics = new ClientRequestMetrics ( "Read" ) ; private static final ClientRequestMetrics rangeMetrics = new ClientRequestMetrics ( "RangeSlice" ) ; private static final ClientRequestMetrics writeMetrics = new ClientRequestMetrics ( "Write" ) ; private static final CASClientRequestMetrics casWriteMetrics = new CASClientRequestMetrics ( "CASWrite" ) ; private static final CASClientRequestMetrics casReadMetrics = new CASClientRequestMetrics ( "CASRead" ) ; private static final double CONCURRENT_SUBREQUESTS_MARGIN = 0.1 ; private StorageProxy ( ) { } public static ColumnFamily cas ( String keyspaceName , String cfName , ByteBuffer key , CASRequest request , ConsistencyLevel consistencyForPaxos , ConsistencyLevel consistencyForCommit , ClientState state ) throws InvalidRequestException , IsBootstrappingException , RequestFailureException , RequestTimeoutException , UnavailableException { } private static Predicate < InetAddress > sameDCPredicateFor ( final String dc ) { } private static Pair < List < InetAddress > , Integer > getPaxosParticipants ( String keyspaceName , ByteBuffer key , ConsistencyLevel consistencyForPaxos ) throws UnavailableException { } private static Pair < UUID , Integer > beginAndRepairPaxos ( long start , ByteBuffer key , CFMetaData metadata , List < InetAddress > liveEndpoints , int requiredParticipants , ConsistencyLevel consistencyForPaxos , ConsistencyLevel consistencyForCommit , final boolean isWrite , ClientState state ) throws WriteFailureException , WriteTimeoutException { } private static void sendCommit ( Commit commit , Iterable < InetAddress > replicas ) { } private static PrepareCallback preparePaxos ( Commit toPrepare , List < InetAddress > endpoints , int requiredParticipants , ConsistencyLevel consistencyForPaxos ) throws WriteTimeoutException { } private static boolean proposePaxos ( Commit proposal , List < InetAddress > endpoints , int requiredParticipants , boolean timeoutIfPartial , ConsistencyLevel consistencyLevel ) throws WriteTimeoutException { } private static void commitPaxos ( Commit proposal , ConsistencyLevel consistencyLevel ) throws WriteFailureException , WriteTimeoutException { boolean shouldBlock = consistencyLevel != ( ConsistencyLevel . ANY ) ; Keyspace keyspace = Keyspace . open ( proposal . update . metadata ( ) . ksName ) ; Token tk = StorageService . getPartitioner ( ) . getToken ( proposal . key ) ; List < InetAddress > naturalEndpoints = StorageService . instance . getNaturalEndpoints ( keyspace . getName ( ) , tk ) ; Collection < InetAddress > pendingEndpoints = StorageService . instance . getTokenMetadata ( ) . pendingEndpointsFor ( tk , keyspace . getName ( ) ) ; AbstractWriteResponseHandler responseHandler = null ; if ( shouldBlock ) { AbstractReplicationStrategy rs = keyspace . getReplicationStrategy ( ) ; responseHandler = rs . getWriteResponseHandler ( naturalEndpoints , pendingEndpoints , consistencyLevel , null , SIMPLE ) ; } MessageOut < Commit > message = new MessageOut < Commit > ( Verb . PAXOS_COMMIT , proposal , Commit . serializer ) ; for ( InetAddress destination : Iterables . concat ( naturalEndpoints , pendingEndpoints ) ) { if ( FailureDetector . instance . isAlive ( destination ) ) { if ( shouldBlock ) <START_BUG> MessagingService . instance ( ) . sendRR ( message , destination , responseHandler ) ; <END_BUG> else MessagingService . instance ( ) . sendOneWay ( message , destination ) ; } } if ( shouldBlock ) responseHandler . get ( ) ; } public static void mutate ( Collection < ? extends IMutation > mutations , ConsistencyLevel consistency_level ) throws OverloadedException , UnavailableException , WriteFailureException , WriteTimeoutException { } private static void hintMutations ( Collection < ? extends IMutation > mutations ) { } @ SuppressWarnings ( "unchecked" ) public static void mutateWithTriggers ( Collection < ? extends IMutation > mutations , ConsistencyLevel consistencyLevel , boolean mutateAtomically ) throws InvalidRequestException , OverloadedException , UnavailableException , WriteFailureException , WriteTimeoutException { } public static void mutateAtomically ( Collection < Mutation > mutations , ConsistencyLevel consistency_level ) throws OverloadedException , UnavailableException , WriteTimeoutException { } private static void syncWriteToBatchlog ( Collection < Mutation > mutations , Collection < InetAddress > endpoints , UUID uuid ) throws WriteFailureException , WriteTimeoutException { } private static void asyncRemoveFromBatchlog ( Collection < InetAddress > endpoints , UUID uuid ) { } private static void syncWriteBatchedMutations ( List < StorageProxy . WriteResponseHandlerWrapper > wrappers , String localDataCenter ) throws OverloadedException , WriteTimeoutException { } public static AbstractWriteResponseHandler performWrite ( IMutation mutation , ConsistencyLevel consistency_level , String localDataCenter , StorageProxy . WritePerformer performer , Runnable callback , WriteType writeType ) throws OverloadedException , UnavailableException { } private static StorageProxy . WriteResponseHandlerWrapper wrapResponseHandler ( Mutation mutation , ConsistencyLevel consistency_level , WriteType writeType ) { } private static class WriteResponseHandlerWrapper { final AbstractWriteResponseHandler handler ; final Mutation mutation ; WriteResponseHandlerWrapper ( AbstractWriteResponseHandler handler , Mutation mutation ) { } } private static Collection < InetAddress > getBatchlogEndpoints ( String localDataCenter , ConsistencyLevel consistencyLevel ) throws UnavailableException { } public static void sendToHintedEndpoints ( final Mutation mutation , Iterable < InetAddress > targets , AbstractWriteResponseHandler responseHandler , String localDataCenter ) throws OverloadedException { } private static AtomicInteger getHintsInProgressFor ( InetAddress destination ) { } public static Future < Void > submitHint ( final Mutation mutation , final InetAddress target , final AbstractWriteResponseHandler responseHandler ) { } private static Future < Void > submitHint ( StorageProxy . HintRunnable runnable ) { } public static void writeHintForMutation ( Mutation mutation , long now , int ttl , InetAddress target ) { }

Fix:
MessagingService . instance ( ) . sendRRWithFailure ( message , destination , responseHandler ) ;