-
-
Notifications
You must be signed in to change notification settings - Fork 928
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
SAM-3170 Convert Timer() thread to ScheduledThreadPoolExecutor() service #4227
Conversation
log.debug("***2. TimedAssessmentQueue.add, after schedule timer="+timer); | ||
} | ||
// Add grading data to the queue | ||
synchronized (queue) { |
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.
synchronized on a ConcurentHashMap.put() is not needed as this method is atomic.
tasks.get(timedAG).cancel(true); | ||
tasks.remove(timedAG); | ||
// Remove the grading data from the queue | ||
synchronized (queue) { |
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.
same as above ConcurrentHashMap.remove() is atomic
Removed synchronization from the ConcurrentHashMap put/remove calls. |
CLA is on file. Removed cla? label. |
Has one file currently in conflict SubmitTimedAssessmentThread.java |
This PR removes that file completely. So I'm a bit confused as to what the conflict is :/ |
The change was on 59e65c3#diff-50bd1651546e802bd2c1022818829dae in SAM-3012 Looks like the diff was changing a event name. So this would have to still be rebased, and the event name EVENT_ASSESSMENT_SUBMITTED_TIMED should be renamed to EVENT_ASSESSMENT_SUBMITTED_TIMER_THREAD
|
I synced this PR with master, and made the appropriate changes to the new constant. |
This replaces the Timer() that runs a single SubmitTimedAssessmentThread at a fixed rate, with a ScheduledThreadPoolExecutor that uses a pool of threads to execute individual TimedAssessmentRunnables at a fixed rate for each timed assessment in progress.
This change adds the property samigo.timerThreadCount with a default value of 4, in case anyone has a need to tune that value.