Please have a look at following log (after all the second part with operation start and result success stopping):

      2012-04-12 11:24:10,450 [main] DEBUG com.*tech.jet.jboss.dmr.DmrClient - About to execute following operation:
      {
          "operation" : "stop",
          "address" : [
              {
                  "host" : "master"
              },
              {
                  "server-config" : "server-1"
              }
          ]
      }
      2012-04-12 11:24:10,469 [Remoting "management-client" write-1] DEBUG org.xnio.nio - Started channel thread 'Remoting "management-client" write-1', selector sun.nio.ch.WindowsSelectorImpl@8bab67
      2012-04-12 11:24:10,490 [Remoting "management-client" read-1] DEBUG org.xnio.nio - Started channel thread 'Remoting "management-client" read-1', selector sun.nio.ch.WindowsSelectorImpl@1f23dc
      2012-04-12 11:24:10,849 [main] DEBUG com.*tech.jet.jboss.dmr.DmrClient - Operation was executed, result is:
      {
          "outcome" : "success",
          "result" : "STOPPING"
      }
      2012-04-12 11:24:10,849 [main] DEBUG com.*tech.jet.jboss.dmr.tasks.DmrGenericJsonTask - Successfully executed DmrGenericJsonTask.
      2012-04-12 11:24:10,855 [main] DEBUG com.*tech.jet.jboss.dmr.template.provider.TemplateProvider - About to parse template 'test-template-domain_server-start'.
      2012-04-12 11:24:10,879 [main] DEBUG com.*tech.jet.jboss.dmr.template.provider.TemplateProvider - Successfully parsed template 'test-template-domain_server-start'.
      2012-04-12 11:24:10,880 [main] DEBUG com.*tech.jet.jboss.dmr.tasks.DmrGenericJsonTask - About to execute DmrGenericJsonTask.
      2012-04-12 11:24:10,880 [main] DEBUG com.*tech.jet.jboss.dmr.DmrClient - About to execute following operation:
      {
          "operation" : "start",
          "address" : [
              {
                  "host" : "master"
              },
              {
                  "server-config" : "server-1"
              }
          ]
      }
      2012-04-12 11:24:10,902 [Remoting "management-client" write-1] DEBUG org.xnio.nio - Started channel thread 'Remoting "management-client" write-1', selector sun.nio.ch.WindowsSelectorImpl@1674a1b
      2012-04-12 11:24:10,944 [Remoting "management-client" read-1] DEBUG org.xnio.nio - Started channel thread 'Remoting "management-client" read-1', selector sun.nio.ch.WindowsSelectorImpl@3243bf
      2012-04-12 11:24:11,201 [main] DEBUG com.*tech.jet.jboss.dmr.DmrClient - Operation was executed, result is:
      {
          "outcome" : "success",
          "result" : "STOPPING"
      }
      2012-04-12 11:24:34,952 [main] DEBUG com.*tech.jet.jboss.dmr.tasks.DmrGenericJsonTask - Successfully executed DmrGenericJsonTask.
      2012-04-12 11:24:51,440 [main] DEBUG com.*tech.jet.jboss.dmr.template.provider.TemplateProvider - About to load template 'test-template-domain_server-restart' with filename 'test/templates/domain/server-restart.xml'.
      2012-04-12 11:24:51,441 [main] DEBUG com.*tech.jet.jboss.dmr.template.provider.TemplateProvider - About to parse template 'test-template-domain_server-restart'.
      2012-04-12 11:24:51,472 [main] DEBUG com.*tech.jet.jboss.dmr.template.provider.TemplateProvider - Successfully parsed template 'test-template-domain_server-restart'.
      2012-04-12 11:24:51,472 [main] DEBUG com.*tech.jet.jboss.dmr.tasks.DmrGenericJsonTask - About to execute DmrGenericJsonTask.
      2012-04-12 11:24:51,472 [main] DEBUG com.*tech.jet.jboss.dmr.DmrClient - About to execute following operation:
      {
          "operation" : "restart",
          "address" : [
              {
                  "host" : "master"
              },
              {
                  "server-config" : "server-1"
              }
          ]
      }
      2012-04-12 11:24:51,488 [Remoting "management-client" read-1] DEBUG org.xnio.nio - Started channel thread 'Remoting "management-client" read-1', selector sun.nio.ch.WindowsSelectorImpl@138d8fa
      2012-04-12 11:24:51,502 [Remoting "management-client" write-1] DEBUG org.xnio.nio - Started channel thread 'Remoting "management-client" write-1', selector sun.nio.ch.WindowsSelectorImpl@11499ff
      2012-04-12 11:24:51,768 [main] DEBUG com.*tech.jet.jboss.dmr.DmrClient - Operation was executed, result is:
      {
          "outcome" : "failed",
          "failure-description" : "JBAS010946: Cannot restart server server-1 as it is not currently started; it is STOPPING",
          "rolled-back" : true
      }
      

      I understand that these operations are executed asynchronously and that the use case is rare, but still it should work.

      Also, if again configuration is changed via dmr having impact on the server being started/stopped/restarted, this leads to subsequent errors.

      In an automated environment, configuration is changed in a row and also servers need to be stopped/started/restarted in this same row. Either an error should be thrown when trying to start a server which is being stopped or maybe, for configuration purposes, a boolean option synchronous could be provided in the handler as param.

      Thanks!

            [AS7-4488] Subsequent stop start of a server leads to errors

            AS7-6754 contains a better description of what's missing.

            Emanuel Muckenhuber (Inactive) added a comment - AS7-6754 contains a better description of what's missing.

            Yes, that would be interesting as well. I need to check how far that is already integrated with our rollout plans though, otherwise it might not be that useful.

            Emanuel Muckenhuber (Inactive) added a comment - Yes, that would be interesting as well. I need to check how far that is already integrated with our rollout plans though, otherwise it might not be that useful.

            A "blocking" parameter sounds perfect.

            For server level operations (start, stop, restart) the param is already there in 7.1.1:

            [domain@localhost:19500 server-config=server-1] :read-operation-description(name=start)
            {
                "outcome" => "success",
                "result" => {
                    "operation-name" => "start-server",
                    "description" => "Start a server.",
                    "request-properties" => {
                        "server" => {
                            "type" => STRING,
                            "description" => "The name of the server.",
                            "required" => true,
                            "min-length" => 1,
                            "nillable" => false
                        },
                        "blocking" => {
                            "type" => BOOLEAN,
                            "default" => false,
                            "description" => "Whether the operation should block and wait until the server is started.",
                            "required" => false,
                            "nillable" => true
                        }
                    },
                    "reply-properties" => {
                        "type" => STRING,
                        "description" => "The status of the server following execution of this operation."
                    },
                    "read-only" => false
                }
            }
            

            But I cannot see it for server-group level:

            [domain@localhost:19500 server-group=server-group-1] :read-operation-description(name=start-servers)
            {
                "outcome" => "success",
                "result" => {
                    "operation-name" => "start-servers",
                    "description" => "Starts all configured servers belonging to the server group in the domain that are not currently running.",
                    "reply-properties" => {},
                    "read-only" => false
                }
            }
            

            It would be nice to have that on server-group level as well.

            Michael Voegele (Inactive) added a comment - A "blocking" parameter sounds perfect. For server level operations (start, stop, restart) the param is already there in 7.1.1: [domain@localhost:19500 server-config=server-1] :read-operation-description(name=start) { "outcome" => "success" , "result" => { "operation-name" => "start-server" , "description" => "Start a server." , "request-properties" => { "server" => { "type" => STRING, "description" => "The name of the server." , "required" => true, "min-length" => 1, "nillable" => false }, "blocking" => { "type" => BOOLEAN, "default" => false, "description" => "Whether the operation should block and wait until the server is started." , "required" => false, "nillable" => true } }, "reply-properties" => { "type" => STRING, "description" => "The status of the server following execution of this operation." }, "read-only" => false } } But I cannot see it for server-group level: [domain@localhost:19500 server-group=server-group-1] :read-operation-description(name=start-servers) { "outcome" => "success" , "result" => { "operation-name" => "start-servers" , "description" => "Starts all configured servers belonging to the server group in the domain that are not currently running." , "reply-properties" => {}, "read-only" => false } } It would be nice to have that on server-group level as well.

            There is a "blocking" parameter for the start and stop operation. I am not entirely sure if that is already in 7.1.1, but this should help.

            I'll keep this issue open for now and see if there are some improvements we could make for a future release.

            Emanuel Muckenhuber (Inactive) added a comment - There is a "blocking" parameter for the start and stop operation. I am not entirely sure if that is already in 7.1.1, but this should help. I'll keep this issue open for now and see if there are some improvements we could make for a future release.

              emuckenhuber_jira Emanuel Muckenhuber (Inactive)
              michael.voegele@cloudops Michael Voegele (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: