-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
29adcbd
to
ac422c0
Compare
} catch (Exception e) { | ||
LOG.error("Cannot notify master about workspace " + wsId + " activity", e); | ||
} | ||
new Thread( |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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
?
@mkuznyetsov could you update |
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
ci-test |
ci-test build report: |
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