Skip to content
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

when reconfiguring, no check for changed appmods is done #457

Open
etnt opened this issue Jul 25, 2022 · 3 comments
Open

when reconfiguring, no check for changed appmods is done #457

etnt opened this issue Jul 25, 2022 · 3 comments

Comments

@etnt
Copy link
Collaborator

etnt commented Jul 25, 2022

case {yaws_config:can_hard_gc(GC, OLDGC),

When running Yaws in embedded mode, and you want to disable an appmod; using the yaws_api:setconf/2 does
not seem to take into account that any appmod config may have changed. Hence, the appmod may be still be invoked (or not)
even if it has been removed (added).

To test my hypothesis, in our application code I called yaws_config:hard_setconfig/2 instead of yaws_api:setconf/2
and now, since the currently running processes are killed, it works as expected to add/remove appmods when reconfiguring.

So I'm not sure if it is ok to change the behaviour of the current yaws_api:setconf/2 function, or if we should add a new
function "yaws_api:hard_setconf/2" (or just call yaws_config:hard_setconfig/2 , but that is a bit ugly imo...).

Cheers, Tobbe

@vinoski
Copy link
Collaborator

vinoski commented Jul 27, 2022

Thanks for the details, will take a closer look.

@vinoski
Copy link
Collaborator

vinoski commented Jul 31, 2022

Seems like we should change yaws_config:soft_setconf/4 to examine appmods for each server config and deal with them appropriately. I'll make this change on a branch so you can try it out.

[update] This really means that the yaws_server calls for updating, deleting, and adding server configs, or functions they call, will have to be taught to handle appmods.

@etnt
Copy link
Collaborator Author

etnt commented Aug 2, 2022

ok, perhaps a simple first approach could be to just open up yaws_api.erl to have a function for hard_setconf/2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants