Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-7987

Remove operations should warn the user if the resource has any dependents

    Details

      Description

      Services may have dependents that can't work if they are not present. Removal operations should prevent, or least warn the user then he is about to remove a service that may have side effects.

      Take a look at this example:

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      [standalone@localhost:9990 /] /subsystem=undertow/configuration=filter/response-header=test:add(header-name=X-test, header-value=test)
      {"outcome" => "success"}
      [standalone@localhost:9990 /] /subsystem=undertow/server=default-server/host=default-host/filter-ref=test:add()
      {"outcome" => "success"}
      [standalone@localhost:9990 /] /subsystem=undertow/configuration=filter/response-header=test:remove()
      {
          "outcome" => "success",
          "response-headers" => {
              "operation-requires-reload" => true,
              "process-state" => "reload-required"
          }
      }
      [standalone@localhost:9990 /] :reload()
      {
          "outcome" => "success",
          "result" => undefined
      }
      [standalone@localhost:9990 /] /core-service=management:read-boot-errors()
      {
          "outcome" => "success",
          "result" => [{
              "failed-operation" => {
                  "operation" => "add",
                  "address" => [
                      ("subsystem" => "undertow"),
                      ("server" => "default-server"),
                      ("host" => "default-host"),
                      ("filter-ref" => "test")
                  ]
              },
              "failure-description" => "{\"WFLYCTL0412: Required services that are not installed:\" => [\"jboss.undertow.filter.test\"],\"WFLYCTL0180: Services with missing/unavailable dependencies\" => [\"jboss.undertow.server.default-server.default-host.filter-ref.test is missing [jboss.undertow.filter.test]\"]}",
              "services-missing-dependencies" => ["jboss.undertow.server.default-server.default-host.filter-ref.test is missing [jboss.undertow.filter.test]"]
          }]
      }
      

      A new Undertow filter is created and assigned to a host. The filter is then removed, but the host still needs it.

      The problem is only seen after a server reload. The same thing happens when you remove, i.e. the default Servlet Container or the Bean pool of the EJB subsystem.

      My proposal is to at least add a response head to the remove operations listing affected (dependent) services. This would complement the new WildFly 11 capability registry.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ctomc Tomaž Cerar
                  Reporter:
                  ggam Guillermo González de Agüero
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: