Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-6514

Recursive reads that involve host resource could fail without returning a descriptive message

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Management
    • None
    • Hide

      Reproduction is quite difficult, but in essence, we have to delay the ReadResourceHandler after committing to read the /host/server children and delay the server registration in ServerService#finishBoot

      See as an example: https://github.com/wildfly/wildfly-core/compare/main...yersan:wildfly-core:WFCORE-6491-reproducer-server?expand=1

      Configure a single managed server in the domain, and make it not start by default.

      Then open two CLI and execute:
      [domain@localhost:9990 /] /host=primary:read-resource(recursive=true, include-runtime=true, recursive-depth=1)

      And then start the managed server:
      [domain@localhost:9990 /] /host=primary/server=server-one:start

      The first operation will return with an error:
      [domain@localhost:9990 /] /host=primary:read-resource(recursive=true, include-runtime=true, recursive-depth=1)

      { "outcome" => "failed", "rolled-back" => true }
      Show
      Reproduction is quite difficult, but in essence, we have to delay the ReadResourceHandler after committing to read the /host/server children and delay the server registration in ServerService#finishBoot See as an example: https://github.com/wildfly/wildfly-core/compare/main...yersan:wildfly-core:WFCORE-6491-reproducer-server?expand=1 Configure a single managed server in the domain, and make it not start by default. Then open two CLI and execute: [domain@localhost:9990 /] /host=primary:read-resource(recursive=true, include-runtime=true, recursive-depth=1) And then start the managed server: [domain@localhost:9990 /] /host=primary/server=server-one:start The first operation will return with an error: [domain@localhost:9990 /] /host=primary:read-resource(recursive=true, include-runtime=true, recursive-depth=1) { "outcome" => "failed", "rolled-back" => true }

      The /host=*/server=* resource can become a proxy resource in the middle of reading /host=*/ recursively. At the first read level, it could be a concrete resource, but once the ReadResourceHandler is committed to reading the /host=*/server=* children, this resource could become a proxy resource and make the operation fail if the server has not finished the booting process.

      I don't think we can do something with the read resource operation, since it is racy regarding the managed server registration and even if the resource has changed to be a proxy, it was not a proxy when it was read by an upper recursive level.

      In this case, returning a descriptive error, something like: "WFLYCTL0379: System boot is in process; execution of remote management operations is not currently available"

      Ignoring the read in such a case could be another approach, however, the operation should succeed in such a case returning no results from the read operation.

            yborgess1@redhat.com Yeray Borges Santana
            yborgess1@redhat.com Yeray Borges Santana
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: