HPCC-30007 Introduce CPooledPersistent and "pooled" sink mode in roxie #17636
HPCC-30007 Introduce CPooledPersistent and "pooled" sink mode in roxie #17636ghalliday merged 1 commit intohpcc-systems:candidate-2.0.xfrom
Conversation
|
https://track.hpccsystems.com/browse/HPCC-30007 |
|
This isn't ready to merge, but I think it would be worthwhile discussing the advantages/disadvantages before cleaning it up. |
| CNodeMapping * next = nullptr; | ||
| }; | ||
|
|
||
| typedef OwningSimpleHashTableOf<CNodeMapping, CKeyIdAndPos> CNodeTable; |
|
|
||
| //================================================================================= | ||
|
|
||
| #define NEW_RESTARTABLE_THREAD |
There was a problem hiding this comment.
Should this be testing NEW_THREADEDPERSISTENT?
I assume it's in here so that we implement IThreaded and can thus make use of the noew global thread pool code...
| else if (!probeManager && !graphDefinition.isSequential() && sinkMode != SinkMode::Sequential) | ||
| { | ||
| if (sinkMode == SinkMode::ParallelPersistent || sinkMode == SinkMode::AutomaticPersistent) | ||
| if (sinkMode == SinkMode::ParallelPersistent || sinkMode == SinkMode::AutomaticPersistent || true) |
There was a problem hiding this comment.
Should be || NEW_THREADEDPERSISTENT ?
There was a problem hiding this comment.
(or words to that effect)
|
|
||
| // CThreadedPersistent | ||
| #ifdef NEW_THREADEDPERSISTENT | ||
| class GlobalThreadPool : public CInterfaceOf<IThreadFactory> |
There was a problem hiding this comment.
The JIRA mentioned that the global thread pool was to gradually shrink over time if threads went unused. I don't see any code here that would do that.
jakesmith
left a comment
There was a problem hiding this comment.
@ghalliday - a few comments.
|
|
||
| #define NEW_RESTARTABLE_THREAD | ||
| #ifdef NEW_RESTARTABLE_THREAD | ||
| class RestartableThread : public CInterface, public IThreaded |
| GlobalThreadPool() | ||
| { | ||
| IExceptionHandler *exceptionHandler = nullptr; | ||
| unsigned defaultmax = 0; |
| unsigned delay = 0; | ||
| unsigned stacksize = 0; // i.e. default; | ||
| unsigned timeoutOnRelease = 0; | ||
| unsigned targetpoolsize = 0; |
There was a problem hiding this comment.
and targetpoolsize will default to defaultmax == 0, meaning it will not scale down
For the replacement of existing CThreadedPersistent semantics, where there is no upper limit to # of threads,
should defaultmax be left as 0, but targetpoolsize be set to something highish but low enough to reduce threads from peak ?
|
|
||
| void CThreadedPersistent::start() | ||
| { | ||
| //MORE: Pass this instead of owner and catch exceptions in this class for later reporting? |
There was a problem hiding this comment.
it's unfortunate that the IExceptionHandler doesn't pass the handle back..
Or, the threadpool::join method should throw the exception if there is no handler..
| { | ||
| if (!joined) | ||
| { | ||
| globalThreadPool.join(handle, timeout); |
There was a problem hiding this comment.
I think the pool impl. of join should be changed to throw if there is no IExceptionHandler.
mckellyln
left a comment
There was a problem hiding this comment.
I think roxie sink can create 5000+ threads in a very short time, we should have idle threads go away after some amount of time.
8fb49b9 to
682b952
Compare
c9ee4bd to
94e9d96
Compare
889b069 to
070106c
Compare
94e9d96 to
431da9a
Compare
|
@jakesmith I am not convinced that this really helps - I tried running thor using it and the timings were insignificant. |
7da64d0 to
ae0c55d
Compare
jakesmith
left a comment
There was a problem hiding this comment.
@ghalliday - not sure what the state of this PR is.
There are some v. old comments of mine/others.
It will not be used by default, correct?
Can it be rebased onto master ?
cb6d603 to
4462083
Compare
9acfb9e to
cb2622f
Compare
cb2622f to
c048e24
Compare
c048e24 to
a984695
Compare
a984695 to
e981448
Compare
ffa04c4 to
7f5aa3f
Compare
|
@jakesmith I think this is ok to merge - it should not have any effect unless the "pooled" sink mode is used. |
e981448 to
d0de6b5
Compare
Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
jakesmith
left a comment
There was a problem hiding this comment.
@ghalliday - looks good afaics.
bbc7b68
into
hpcc-systems:candidate-2.0.x
Type of change:
Checklist:
Smoketest:
Testing: