Bug #3233
closedRudder restarts jetty every two promise execution if we change the webapp context URL
Description
If we change Rudder webapp context URL (by changing jetty and apache files), the distribute-policy Rule could not find check if the status of the webapp is OK, so it thinks its not running and force jetty restart on the next run.
I changed my context URL to "myLittleRudder" so access to my webapp is http://server.rudder.local/myLittleRudder and the url the API status is http://server.rudder.local/myLittleRudder/api/status
but the promise keeps on checking rudder/api/status because the context URL is hardcoded in the distribute policy
Here is the extract of alive-check and the bundle root-alive-check which cause the problem:
bundle agent root_alive_check { vars: "apps_to_check" slist => { "rudder", "endpoint" }; methods: "any" usebundle => generic_alive_check("$(apps_to_check)"); } bundle agent generic_alive_check(app) { vars: "site_to_check" string => "http://localhost:8080/$(app)/api/status"; "sitename" string => canonify("$(site_to_check)"); "cleanup_failed_classes" slist => { "site_down_once_$(sitename)", "site_alivecheck_restart_jetty_$(sitename)" }; "failed_result_class" string => "site_down_once_$(sitename)", ifvarclass => "!site_down_once_$(sitename).!first_iteration_passed"; "site_failure_persist_time" string => "10", ifvarclass => "!site_down_once_$(sitename).!first_iteration_passed"; "failed_result_class" string => "site_alivecheck_restart_jetty_$(sitename)", ifvarclass => "site_down_once_$(sitename).!first_iteration_passed"; "site_failure_persist_time" string => "0", ifvarclass => "site_down_once_$(sitename).!first_iteration_passed"; classes: "first_iteration_passed" expression => "any"; methods: "any" usebundle => generic_process_check_process(".*java.*/opt/rudder/jetty7/start.jar", "jetty", "true"), ifvarclass => "site_alivecheck_restart_jetty_$(sitename)", classes => set_persist_classes("site_alivecheck_jetty_restarted_$(sitename)", "site_down_once_$(sitename)" ,"0"); [...]
The context URL should not be hardcoded in that promise
I target 2.4.3 as i saw it happen in 2.5 and 2.4.3, it may be the case to in 2.3 too.