Gerrrr commented on a change in pull request #1232:
URL: https://github.com/apache/cassandra/pull/1232#discussion_r724925224
##########
File path: src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java
##########
@@ -275,23 +275,40 @@ private boolean deliver(HintsDescriptor descriptor,
InetAddressAndPort address)
if (offset != null)
dispatcher.seek(offset);
- if (dispatcher.dispatch())
+ try
{
- store.delete(descriptor);
- store.cleanUp(descriptor);
- logger.info("Finished hinted handoff of file {} to
endpoint {}: {}", descriptor.fileName(), address, hostId);
- return true;
+ boolean dispatchResult = dispatcher.dispatch();
+ if (dispatchResult)
+ {
+ store.delete(descriptor);
+ store.cleanUp(descriptor);
+ logger.info("Finished hinted handoff of file {} to
endpoint {}: {}", descriptor.fileName(), address, hostId);
+ return true;
+ }
+ else
+ {
+ handleDispatchFailure(dispatcher, descriptor, address);
+ return false;
+ }
}
- else
+ // we wrap InterruptedException in AssertionError
+ // without that catch, undispatched HintsDescriptor won't be
added back to the store and cleaned up by
+ // HintsStore.delete
+ catch (AssertionError e)
Review comment:
0f3bafd
##########
File path: src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java
##########
@@ -275,23 +275,40 @@ private boolean deliver(HintsDescriptor descriptor,
InetAddressAndPort address)
if (offset != null)
dispatcher.seek(offset);
- if (dispatcher.dispatch())
+ try
{
- store.delete(descriptor);
- store.cleanUp(descriptor);
- logger.info("Finished hinted handoff of file {} to
endpoint {}: {}", descriptor.fileName(), address, hostId);
- return true;
+ boolean dispatchResult = dispatcher.dispatch();
Review comment:
Good point! Fixed in e57ec7e.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]