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
Let reload_cluster not check some config values #1752
Conversation
src/ejabberd_config.erl
Outdated
filter_out_gd_endpoints([Opt | Opts]) -> | ||
[Opt | filter_out_gd_endpoints(Opts)]. | ||
|
||
delete_path_in_proplist(Plist, [Step]) -> |
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.
@fenek, if you know of any function in stdlib that could replace this definition (that is a solution for a very generic problem of nested proplists), let me know - I haven't found one.
Codecov Report
@@ Coverage Diff @@
## master #1752 +/- ##
==========================================
- Coverage 74.47% 74.45% -0.03%
==========================================
Files 290 290
Lines 26931 26947 +16
==========================================
+ Hits 20058 20064 +6
- Misses 6873 6883 +10
Continue to review full report at Codecov.
|
Let's confirm that it works on dev machine, as there are no |
src/ejabberd_config.erl
Outdated
% between nodes in cluster. Each option is expressed as | ||
% a list of keys in proplist that should be deleted (if such | ||
% path exists). The `root path` for them is a list of modules. | ||
node_specific_module_options() -> |
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.
Hmm, can this path go into ejabberd.cfg itself?
I don't like it to be hardcoded.
It feels extremely installation-specific. For different clients we can have different per-node parameters.
I even think there would be installations with the same endpoints for all nodes.
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.
I'm not sure if it's not too meta. These hardcoded are the options that MIGHT be different and we don't require them to be the same (but they might be). It is not user's role to define them, I think.
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.
IMO can be done as a separate task. This PR solves immediate issue.
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.
@kanes115 I agree with @arcusfelis. It wouldn't be too meta and we already have config options only for advanced users, so why not affect the reload_cluster
logic?
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.
Yea, I agree
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.
Fine for now, because it is a priority ha... fix, but we should go more meta later in a separate PR.
And we need tests for reload_cluster in a separate PR.
… into improve_reload_cluster_v2
01ed5d4
to
017a5d9
Compare
src/ejabberd_config.erl
Outdated
|
||
filter_out_node_specific_options([]) -> | ||
[]; | ||
filter_out_node_specific_options([{local_config, {modules, Host}, Mods} | Opts]) -> % use record |
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.
Use record here in pattern matching
56a00c2
to
ef91d82
Compare
It also refactors the creation of the node_specific_options list.
161c9b8
to
95e017e
Compare
Right now we just filter this option out of config when calculating sha with
ejabberd_config:filter_out_node_specific_endpoints/1
called incompute_config_file_version/1
andcompute_config_version/1
. In the future it should probably be more general (if the number of such different-among-nodes options increase).