Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too fast timeout when connecting Mbean. #33

Closed
junoyoon opened this issue Mar 3, 2014 · 1 comment
Closed

Too fast timeout when connecting Mbean. #33

junoyoon opened this issue Mar 3, 2014 · 1 comment
Labels
Milestone

Comments

@junoyoon
Copy link
Contributor

junoyoon commented Mar 3, 2014

Whenever the mbeanclient is used, nGrinder makes timeout exception when it takes more than 1 sec. Usually it works when the ngrinder controller and target is close, However it might not workable in the distant environment.

    private JMXConnector connectWithTimeout(final JMXServiceURL jmxUrl, int timeout) throws NGrinderRuntimeException, TimeoutException {
        try {
            ExecutorService executor = Executors.newSingleThreadExecutor();
            Future<JMXConnector> future = executor.submit(new Callable<JMXConnector>() {
                public JMXConnector call() throws IOException {
                    return JMXConnectorFactory.connect(jmxUrl);
                }
            });

            return future.get(timeout, TimeUnit.MILLISECONDS);
        } catch (TimeoutException e) {
            throw e;
        } catch (Exception e) {
            throw processException(e);
        }
    }

We need to make it configurable, so that the Mbeanclient client uses its own connection timeout value.

@junoyoon
Copy link
Contributor Author

Fixed

lopiter pushed a commit that referenced this issue Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant