[jboss-jira] [JBoss JIRA] (WFLY-4373) WildFly CLI API ModelControllerClient deadlock?

Richard Opalka (JIRA) issues at jboss.org
Thu May 14 17:03:19 EDT 2015


     [ https://issues.jboss.org/browse/WFLY-4373?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Opalka updated WFLY-4373:
---------------------------------
    Attachment: client.war
                sample.war


Cannot reproduce the problem neither on 8.2.0.Final nor on 9.x nor master.
I'm attaching reproduction files I used when I tried to reproduce the problem.
In order to run the test both archives need to be deployed (e.g. via cli).
Then access the following URL

http://localhost:8080/client/test

in the browser.

{code}
package org.wildfly.jira4373;

import org.jboss.as.controller.client.ModelControllerClient;
import org.jboss.dmr.ModelNode;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class ManagementClientServlet extends HttpServlet {

    private int port = -1;
    private int count = -1;

    @Override
    public void init(ServletConfig config) throws ServletException {
        port = Integer.valueOf(config.getInitParameter("server-port"));
        count = Integer.valueOf(config.getInitParameter("redeploy-count"));
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {
        for (int i = 0; i < count; i++) {
            try {
                System.out.println("--- BEFORE MANAGEMENT OPERATION [" + i + "] ---");
                ModelControllerClient cl = ModelControllerClient.Factory.create("localhost", port);
                ModelNode operation = new ModelNode();
                operation.get("operation").set("redeploy");
                operation.get("address").add("deployment", "sample.war");
                ModelNode result = cl.execute(operation);
                System.out.println(result);
                cl.close();
                System.out.println("--- AFTER  MANAGEMENT OPERATION [" + i + "] ---");
            } catch (Throwable t) {
                System.err.println("--- FAILED MANAGEMENT OPERATION [" + i + "] ---");
                t.printStackTrace(System.err);
            }
        }
    }
}
{code}


> WildFly CLI API ModelControllerClient deadlock?
> -----------------------------------------------
>
>                 Key: WFLY-4373
>                 URL: https://issues.jboss.org/browse/WFLY-4373
>             Project: WildFly
>          Issue Type: Bug
>          Components: Domain Management, IO
>    Affects Versions: 8.2.0.Final
>         Environment: Ubuntu 14.04 LTS, Java 1.8, xnio-api and xnio-nio are 3.3.0.Final
>            Reporter: Georgy Go
>            Assignee: Tomaz Cerar
>              Labels: cli, dmr
>         Attachments: client.war, sample.war, threaddump.zip
>
>
> The following snippet of code to redeploy an application:
> ModelControllerClient cl = ModelControllerClient.Factory.create("localhost", 9999);
> ModelNode operation = new ModelNode();
> operation.get("operation").set("redeploy");
> operation.get("address").add("deployment", "server.war");
> cl.execute(operation);
> cl.close();
> - works fine, but .close() freezes forever.
> This issue depends to not only redeploy, but also for any other operations.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list