netudima commented on code in PR #4454:
URL: https://github.com/apache/cassandra/pull/4454#discussion_r2479564055
##########
src/java/org/apache/cassandra/service/GCInspector.java:
##########
@@ -396,15 +426,48 @@ public long getGcWarnThresholdInMs()
public void setGcLogThresholdInMs(long threshold)
{
- if (threshold <= 0)
- throw new IllegalArgumentException("Threshold must be greater than
0");
+ try
+ {
+ DatabaseDescriptor.setGCLogThreshold((int) threshold);
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalArgumentException(t.getMessage());
+ }
+ }
- long gcWarnThresholdInMs = getGcWarnThresholdInMs();
- if (gcWarnThresholdInMs != 0 && threshold > gcWarnThresholdInMs)
- throw new IllegalArgumentException("Threshold must be less than
gcWarnThresholdInMs which is currently "
- + gcWarnThresholdInMs);
+ public int getGcConcurrentPhaseWarnThresholdInMs()
+ {
+ return DatabaseDescriptor.getGCConcurrentPhaseWarnThreshold();
+ }
- DatabaseDescriptor.setGCLogThreshold((int) threshold);
+ public void setGcConcurrentPhaseWarnThresholdInMs(int threshold)
+ {
+ try
+ {
+ DatabaseDescriptor.setGCConcurrentPhaseWarnThreshold(threshold);
+ }
+ catch (Throwable t)
Review Comment:
should we catch only ConfigurationException here if it is just a translation
from ConfigurationException to IllegalArgumentException?
catch (Throwable t) is very strong thing and can hide potentially things
like OOM, classloading issues, etc
also, I think it would be nice to leave a comment for future generations why
do we do 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]