You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/03/17 11:01:53 UTC

[GitHub] [cassandra] adelapena commented on a change in pull request #1485: CASSANDRA-17197: Diagnostic events for guardrails

adelapena commented on a change in pull request #1485:
URL: https://github.com/apache/cassandra/pull/1485#discussion_r828998229



##########
File path: test/unit/org/apache/cassandra/db/guardrails/GuardrailsTest.java
##########
@@ -129,7 +129,7 @@ public void testThresholdUsers() throws Throwable
 
         // value over fail threshold. An undefined user means that the check comes from a background process,
         // so we warn instead of failing to prevent interrupting that process.
-        assertWarns(() -> guard.guard(101, "z", null), "Failure: for z, 101 > 100");
+        assertFails(() -> guard.guard(101, "z", null), false, "Failure: for z, 101 > 100");

Review comment:
       Now this is using the boolean `thrown` argument in `GuardrailsTester#assertFails` to indicate that this triggers the fail threshold but it shouldn't throw an exception (because of the null `ClientState`). That means that from client's perspective it only emits a client warning instead of failing, but it still emits an internal log message with `ERROR` level, and a `GuardrailEventType.ERROR` diagnostic event. So it's strictly an error but it doesn't abort the operation.
   
   I have tried to improve the comment to better reflect this.




-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org