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 CountLatch to use it for StatsCmd. #520

Merged
merged 2 commits into from Nov 9, 2016

Conversation

dipak-pawar
Copy link
Contributor

Short description of what this resolves:

Only tomcat container is stopping other thread execution even if call onComplete() event in StatsLogsResultCallback when you have added recorder dependency in your class path.

Changes proposed in this pull request:

  • Added CountDownLatch for StatsLogsResultCallback So even if after onComplete event is stopping execution of other thread, it'll timeout after timeout period.

Fixes: #519

try {
statsCmd.exec(statslogs).awaitCompletion();
StatsLogsResultCallback statscallback = statsCmd.exec(statslogs);
countDownLatch.await(3, TimeUnit.SECONDS);
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to 5 seconds, I am thinking on remote docker host.

Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we make it configurable then?

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be possible to use CompletableFuture instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bartoszmajsak What do you mean by configurable? We have added countdownlatch only not to go in deadlock.

Copy link
Member

Choose a reason for hiding this comment

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

I mean we hardcoded to 5s instead of 3s based on some assumptions. What if my machine is even slower so I might need a bit longer timeout?

@lordofthejars lordofthejars merged commit 8d011ee into arquillian:master Nov 9, 2016
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.

None yet

3 participants