jmckenzie-dev commented on code in PR #4727:
URL: https://github.com/apache/cassandra/pull/4727#discussion_r3074282143
##########
src/java/org/apache/cassandra/db/ReadCommandVerbHandler.java:
##########
@@ -87,17 +88,28 @@ public void doVerb(Message<ReadCommand> message)
{
response = command.createResponse(iterator,
controller.getRepairedDataInfo());
}
+ catch (AssertionError t)
+ {
+ throw new AssertionError(String.format("Caught an error while
trying to process the command: %s", command.toCQLString()), t);
+ }
+ catch (QueryCancelledException e)
+ {
+ logger.debug("Query cancelled (timeout)", e);
+ response = null;
+ assert !command.isCompleted() : "Read marked as completed despite
being aborted by timeout to table " + command.metadata();
Review Comment:
How would you feel about moving to
[Preconditions](https://guava.dev/releases/19.0/api/docs/com/google/common/base/Preconditions.html)
here? I ask because our abuse of assertions in production code Makes Me Sad to
this day, so in every scenario where I can move that needle, even if only
slightly, I feel like it's worth it. :)
--
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]