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

Added wildfly12 profile #165

Merged
merged 1 commit into from
Mar 16, 2018
Merged

Added wildfly12 profile #165

merged 1 commit into from
Mar 16, 2018

Conversation

olukas
Copy link
Collaborator

@olukas olukas commented Mar 15, 2018

Added wildfly12 profile and activate it by default for tests.

Implementation of executeAsync in HttpModelControllerClient was added due to changes in WildFly Core in wildfly/wildfly-core@4713ebe#diff-bb461a3456601632260a50ddc3cc462cR628.

@olukas olukas requested a review from mchoma March 15, 2018 07:07
@olukas
Copy link
Collaborator Author

olukas commented Mar 15, 2018

Failed test cases (JournalStoreVsJdbcStoreOnlineTest and ChangeJdbcAttributesOnlineTest) in Travis CI are not caused by this PR. I reported and issue #166 for those test cases.

@Override
public AsyncFuture<ModelNode> executeAsync(ModelNode modelNode, OperationMessageHandler handler) {
throw new UnsupportedOperationException("Asynchronous execution is not supported by " + getClass().getName());
ExecutorService executor = Executors.newSingleThreadExecutor();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is the executor shut down? I guess the ...AsyncFutureTask doesn't shutdown the executor after it's completed, so you'll keep leaking threads.

Given that this class has a close method, maybe it would be better to have one Executors.newCachedThreadPool() executor for the entire instance of this class, which you could shutdown in the close method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for advice. Calling shutdown() was missing. Use only one ExecutorService for entire instance is better solution. I fixed it in suggested way.

}
}

private ExecutorService obtainExecutorService() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the executor service needs to be created lazily; if the client is created, it's extremely likely to be used :-) But I'll leave it to you -- this is good too.

Copy link
Collaborator Author

@olukas olukas Mar 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created it lazily because older version than WildFly 12 still uses execute method instead of executeAsync. I believe it is better to create ExecutorService only on demand.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, very much true! Makes sense.

@olukas olukas merged commit da382de into wildfly-extras:master Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants