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

Send request with activity on ws-agent in a separate thread #9708

Merged
merged 4 commits into from
May 17, 2018

Conversation

mkuznyetsov
Copy link
Contributor

What does this PR do?

On WS-Agent, sending requests will be performed in separate threads, to prevent blocking the tomcat thread if request takes too long to complete.

What issues does this PR fix or reference?

#9126

Release Notes

Docs PR

@benoitf benoitf added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. kind/bug Outline of a bug - must adhere to the bug report template. labels May 16, 2018
} catch (Exception e) {
LOG.error("Cannot notify master about workspace " + wsId + " activity", e);
}
new Thread(
Copy link
Member

Choose a reason for hiding this comment

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

Should not be this thread daemon?

} catch (Exception e) {
LOG.error("Cannot notify master about workspace " + wsId + " activity", e);
}
new Thread(
Copy link
Member

Choose a reason for hiding this comment

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

We need new Thread only when onActivity method is called but not when scheduleActivityNotification. Then maybe it would be better to have two methods: notifyActivity and notifyActivityAsync?

@skabashnyuk
Copy link
Contributor

@mkuznyetsov could you update onActivity javadoc according to the new changes?

@mkuznyetsov
Copy link
Contributor Author

ok

*/
public void onActivity() {
long currentTime = System.currentTimeMillis();
if (currentTime < (lastUpdateTime + threshold)) {
activeDuringThreshold.set(true);
} else {
notifyActivity();
Thread activityRequestThread = new Thread(this::notifyActivity);
activityRequestThread.setDaemon(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

give some meaningful name to this thread.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@mkuznyetsov
Copy link
Contributor Author

ci-test

@codenvy-ci
Copy link

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:9708
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@mkuznyetsov mkuznyetsov merged commit 611bf55 into master May 17, 2018
@mkuznyetsov mkuznyetsov deleted the che-9126 branch May 17, 2018 09:02
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label May 17, 2018
@benoitf benoitf added this to the 6.6.0 milestone May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants