-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-31545 Thread pool wait time reporting #18475
HPCC-31545 Thread pool wait time reporting #18475
Conversation
9aade6b
to
e26dc1c
Compare
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-31545 Jirabot Action Result: |
@@ -1017,13 +1026,11 @@ class CThreadPool: public CThreadPoolBase, implements IThreadPool, public CInter | |||
throw MakeStringException(0, "No threads available in pool %s", poolname.get()); | |||
IWARNLOG("Pool limit exceeded for %s", poolname.get()); |
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.
This code continues on with a new thread even when it timed out waiting for a free slot (when timeout == 0)
Is that what we want ? Should it instead wait 'forever' for a free slot when timeout == 0 ?
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.
if parameter 'timeout' is 0 (and noBlock=false), then it will have waited for 'delay' ms.
I think it's correct/by design, to have waited for 'delay' ms, then continue in that case.
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.
trivial/formatting/not new: line 1024 is only line formatted without brace on newline, would be good to change so consistent with rest of function
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.
@mckellyln - looks good, can be merged as is. A couple of minor comments.
@@ -1017,13 +1026,11 @@ class CThreadPool: public CThreadPoolBase, implements IThreadPool, public CInter | |||
throw MakeStringException(0, "No threads available in pool %s", poolname.get()); | |||
IWARNLOG("Pool limit exceeded for %s", poolname.get()); |
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.
if parameter 'timeout' is 0 (and noBlock=false), then it will have waited for 'delay' ms.
I think it's correct/by design, to have waited for 'delay' ms, then continue in that case.
@@ -1017,13 +1026,11 @@ class CThreadPool: public CThreadPoolBase, implements IThreadPool, public CInter | |||
throw MakeStringException(0, "No threads available in pool %s", poolname.get()); | |||
IWARNLOG("Pool limit exceeded for %s", poolname.get()); |
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.
trivial/formatting/not new: line 1024 is only line formatted without brace on newline, would be good to change so consistent with rest of function
} | ||
if (traceStartDelayPeriod) | ||
{ | ||
++startsInPeriod; | ||
if (timedout) | ||
if (waited) |
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.
Don't think it really matters, but if there's an accumulate delay, but as it crosses the 1 minute mark (the 'traceStartDelayPeriod' period), 'waited' isn't true, then it won't report until the next delayed thread.
Perhaps change to:
if (traceStartDelayPeriod)
{
++startsInPeriod;
if (waited)
startDelayInPeriod += startTimer.elapsedCycles();
if (startDelayInPeriod && (overAllTimer.elapsedCycles() >= queryOneSecCycles()*traceStartDelayPeriod)) // check avg. delay per minute
{
....
}
}
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.
I agree, good find. I would even say tho I want to know how many threads started even if there is no accumulated delay, so I don't think we need the extra check of if(startDelayInPeriod) to log the info. See commit 2.
@@ -1185,7 +1185,7 @@ class CKJService : public CSimpleInterfaceOf<IKJService>, implements IThreaded, | |||
{ | |||
Owned<CProcessorFactory> factory = new CProcessorFactory(*this); | |||
processorPool.setown(createThreadPool("KJService processor pool", factory, this, keyLookupMaxProcessThreads, 10000)); | |||
processorPool->setStartDelayTracing(60000); | |||
processorPool->setStartDelayTracing(60); |
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.
whoops, good change!
Perhaps we should just default it to 60seconds in CThreadPool ?
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.
Sure if you want I can change default.
0ab0e2a
to
9e179b4
Compare
@jakesmith made those changes and am requesting a quick re-review, thanks. |
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.
Changes look good to me
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.
@mckellyln - looks good. Please squash.
Signed-off-by: Mark Kelly <[email protected]>
9e179b4
to
6c1435f
Compare
Squashed, should be good to merge. |
4f7b613
into
hpcc-systems:candidate-9.4.x
Type of change:
Checklist:
Smoketest:
Testing: