-
-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix alarm setting typo treshold
-> threshold
#350
Conversation
@essen what about this PR? |
I have updated the CI, please force push to run CI again. |
17d658c
to
2436ade
Compare
@@ -597,7 +597,7 @@ misc_connection_alarms(_) -> | |||
Self ! {connection_alarm, {Ref, AlarmName, length(ActiveConns)}} | |||
end, | |||
Alarms0 = #{ | |||
test1 => Alarm1 = #{type => num_connections, treshold => 2, cooldown => 0, callback => AlarmCallback}, | |||
test1 => Alarm1 = #{type => num_connections, threshold => 2, cooldown => 0, callback => AlarmCallback}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably keep a test that uses treshold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do, see the next line after this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahah understood. In that case a comment before the next line should say that we are testing for backward compatibility but that it should be removed in 3.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in last commit.
The setting `threshold` was misspelled as `treshold`.
b3dc646
to
37d77a9
Compare
Merged, thanks! |
Fixes #349.
The misspelled option
treshold
is still accepted byranch:start_listener/5
andranch:set_transport_options/2
, and will be normalized tothreshold
internally. The transport options are however stored inranch_server
as they were given (ie, with possibly misspelledtreshold
s), such thatranch:get_transport_options/1
returns them unchanged. It would have been easier to store them normalized, but there is an (admittedly off) chance that this may break existing code which has expectations as to the naming of the key in the return fromranch:get_transport_options/1
.I also changed the
alarm
type by changing thetreshold
key tothreshold
. I did, however, not do anything to also allow thetreshold
key there, so dialyzer may (ie, I didn't check) complain on existing code using it. I think this is just as well, since it would serve as an incentive to adapt.The documentation has been adapted by replacing all occurrences of "treshold" or "Treshold" with "threshold" or "Threshold", respectively. The
treshold
key is now effectively undocumented.The respective test
acceptor_SUITE:misc_connection_alarms
, which uses two alarms, has been changed such that one uses the properly spelled and one the misspelled option.