cmux: CircuitPriorityHalflife value is never taken from the consensus
Commit 6b1dba214db
introduced an issue that makes the cmux EWMA subsystem to never use the CircuitPriorityHalflife
option from the consensus resulting in a warning at bootup:
Mar 21 22:31:24.001 [warn] CircuitPriorityHalflife is too small (-1.000000). Adjusting to the smallest value allowed: 30.000000.
The default config is:
V(CircuitPriorityHalflife, DOUBLE, "-1.0"), /*negative:'Use default'*/
Which means that in get_circuit_priority_halflife()
which is called at bootup when loading the config file and when a new consensus arrives, always skip the consensus param check due to this wrong condition (EPSILON=0.0001):
+ if (options && options->CircuitPriorityHalflife < EPSILON) {
+ halflife = options->CircuitPriorityHalflife;
+ *source_msg = "CircuitPriorityHalflife in configuration";
+ goto end;
+ }
Originally, the condition was this which resulted in false with -1.0 and thus trying the consensus param instead:
- if (options && options->CircuitPriorityHalflife >= -EPSILON) {
- halflife = options->CircuitPriorityHalflife;
- source = "CircuitPriorityHalflife in configuration";
The good news is that we didn't release that commit yet! and the default value is what currently the consensus is using (30000) :). Nevertheless, this should be fixed asap.