Mmuzaf commented on code in PR #2046:
URL: https://github.com/apache/cassandra/pull/2046#discussion_r1170103124
##########
src/java/org/apache/cassandra/gms/FailureDetector.java:
##########
@@ -93,16 +94,14 @@ public FailureDetector()
private static long getInitialValue()
{
- String newvalue = System.getProperty("cassandra.fd_initial_value_ms");
- if (newvalue == null)
- {
+ Long newValue = FD_INITIAL_VALUE_MS.getLong();
+ if (newValue == null)
return Gossiper.intervalInMillis * 2;
- }
- else
- {
- logger.info("Overriding FD INITIAL_VALUE to {}ms", newvalue);
- return Integer.parseInt(newvalue);
- }
+
+ if (newValue != Gossiper.intervalInMillis * 2)
Review Comment:
As I mentioned it here:
https://github.com/apache/cassandra/pull/2046#discussion_r1170095535
The `isDefault` will not work because the `Gossiper.intervalInMillis * 2` is
calculated at runtime, so there is no need to compare it with the `defaultVal`,
which is always null in such cases. So we either move the default value to
`FD_INITIAL_VALUE_MS` (removing the dependency on `Gossiper.intervalInMillis`)
or leave everything 'as is', as there are only a few cases with such a usage
pattern. I think the latter is the best option for us as it has no impact on
the API.
--
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]