River-344 - replacing TaskManager in SDM

2014-01-24 Thread Peter Firmstone
Notes: ServiceDiscoveryManager NotifyEventTask If the task list contains any RegisterListenerTasks or LookupTasks associated with this task's lookup service (ProxyReg), and if those tasks were queued prior to this task (have lower sequence numbers), then run those tasks before thi

Replacing TaskManager with ExecutorService

2014-01-13 Thread Peter Firmstone
Two emails are worth reflecting on, as is River-344, this relates to replacing TaskManager with ExecutorService. http://mail-archives.apache.org/mod_mbox/river-dev/201107.mbox/%3cbb4ad312-53c1-4ce6-9bff-01e5cc344...@sorcersoft.org%3e http://mail-archives.apache.org/mod_mbox/river-dev/201105

Re: TaskManager as an ExecutorService

2014-01-08 Thread Peter
> > > > > > This linking of application behavior into utility APIs is just not > > > good, testable design.    It requires that behaviors on the outside > > > of the pool, flow through to other uses of the API in > > > non-programatic design ways. >

Re: TaskManager as an ExecutorService

2014-01-08 Thread Gregg Wonderly
that behaviors on the outside of the pool, >> flow through to other uses of the API in non-programatic design ways. >> >> Gregg Wonderly >> >> On Jan 4, 2014, at 7:46 PM, Peter wrote: >> >>> For a moment, lets consider how we might fix TaskM

Fixing ServiceDiscoveryManager WAS: Re: TaskManager as an ExecutorService

2014-01-06 Thread Peter
havior into utility APIs is just not > > good, testable design.   It requires that behaviors on the outside of > > the pool, flow through to other uses of the API in non-programatic > > design ways. > > > > Gregg Wonderly > >         > > On Jan 4, 2014, at 7:46

Re: TaskManager as an ExecutorService

2014-01-06 Thread Peter
the outside of the pool, > flow through to other uses of the API in non-programatic design ways. > > Gregg Wonderly >         > On Jan 4, 2014, at 7:46 PM, Peter wrote: > > > For a moment, lets consider how we might fix TaskManager, while > > retaining the existing

Re: TaskManager as an ExecutorService

2014-01-05 Thread Gregg Wonderly
: > For a moment, lets consider how we might fix TaskManager, while retaining the > existing Task.runAfter method and how the fix would impact TaskManager's > users. > > TaskManager, like most thread pools has a queue. > > Before a task is removed from the queue for ex

Re: TaskManager as an ExecutorService

2014-01-04 Thread Peter
For a moment, lets consider how we might fix TaskManager, while retaining the existing Task.runAfter method and how the fix would impact TaskManager's users. TaskManager, like most thread pools has a queue. Before a task is removed from the queue for execution, it is asked if it s

Re: TaskManager as an ExecutorService

2014-01-04 Thread Peter
The problem is with TaskManager's public api method Task.runAfter. This is well documented in River-344. The fix requires changing every class that uses it As a thread pool TaskManager is correct provided that no ordering dependencies exist between tasks. TaskManager doesn't compa

Re: TaskManager as an ExecutorService

2014-01-04 Thread Greg Trasuk
I’d like you to make a reasonable case for why TaskManager needs to be replaced, requiring changes to many other classes that depend on TaskManager, rather than stating what the problem is with TaskManager and seeking to fix it, which would only affect TaskManager and not require modifying and

TaskManager as an ExecutorService

2014-01-04 Thread Peter Firmstone
Would you like me to add this class, so that existing configurations utilising a TaskManager can also be used? This might be useful for retaining backward compatibility with existing configurations? Regards, Peter. /* * Licensed to the Apache Software Foundation (ASF) under one * or more

Re: What is wrong with TaskManager?

2013-04-09 Thread Mark Brouwer
Hi Patricia, On 4/8/13 4:32 PM, Patricia Shanahan wrote: Thanks for the background. The general performance of TaskManager, and especially the overhead for runAfter, seemed to me to depend strongly on the queue length. For example, a non-trivial runAfter method scans the list of tasks older

Re: What is wrong with TaskManager?

2013-04-08 Thread Patricia Shanahan
rogrammer, opposed to putting the burden on them to arrange for it themselves.". I concluded runAfter is *not evil* by itself when properly used, although it gives some overhead and it has to perform its work while a lock has been held. ... Thanks for the background. The general performance of

Re: test failure repeatability - TaskManager

2013-04-05 Thread Peter
els messy to me. > Agreed, we should probably consider each case individually, I noticed there's a configuration property that allows a TaskManager instance to be injected on a number of occasions too, which suggests there might be some sharing. Peter. > On 4/3/2013 2:04 PM, Dan Creswe

Re: test failure repeatability - TaskManager

2013-04-03 Thread Patricia Shanahan
with the idea of understanding the use cases before designing the solution, and with using standard API classes as much as possible. The table I sent you was intended as a first step towards that. I'm not convinced that the right solution is a single TaskManager successor. Different TaskManag

Re: test failure repeatability - TaskManager

2013-04-03 Thread Dan Creswell
e with the idea of understanding the use cases before designing the > solution, and with using standard API classes as much as possible. The > table I sent you was intended as a first step towards that. > > I'm not convinced that the right solution is a single TaskManager > successo

Re: test failure repeatability - TaskManager

2013-04-03 Thread Patricia Shanahan
I agree with the idea of understanding the use cases before designing the solution, and with using standard API classes as much as possible. The table I sent you was intended as a first step towards that. I'm not convinced that the right solution is a single TaskManager successor. Diff

Re: test failure repeatability - TaskManager

2013-04-03 Thread Peter
Gut feeling suggests the solution will be executor based, so you're asking good questions, I think we need to understand the use cases better and probably redesign dependant code too. One example of retry, the task will continue attemtping to retry for an entire day. We might need some kind of

Re: test failure repeatability - TaskManager

2013-04-02 Thread Patricia Shanahan
, because whenever a task finishes the TaskManager has to ask each waiting task whether it still needs to wait for any older task. I wanted to change it so that TaskManager would know which task was being waited for. It could then associate with one task a list of tasks that need to be reconsidered when

Re: test failure repeatability - TaskManager

2013-04-02 Thread Bryan Thompson
I am not clear on the semantics for runAfter, but maybe this can be achieved by wrapping a Runnable within another Runnable such that the 2nd runnable is automatically scheduled after the first has succeeded? Likewise, it is possible to wrap a Runnable in order to automatically retry if it throws a

Re: test failure repeatability - TaskManager

2013-04-02 Thread Peter Firmstone
t attempt at taskA fails, and it puts itself back on the TaskManager queue, using the normal add call. Now taskA is after taskB. Patricia On 4/2/2013 12:38 AM, Peter Firmstone wrote: The formatting didn't work out, I'll create a Jira issue to discuss. Patricia's done a great j

Re: test failure repeatability - TaskManager

2013-04-02 Thread Patricia Shanahan
. Suppose taskA is a RetryTask, taskB is supposed to runAfter taskA, and originally appears on the queue after taskA. The first attempt at taskA fails, and it puts itself back on the TaskManager queue, using the normal add call. Now taskA is after taskB. Patricia On 4/2/2013 12:38 AM, Peter F

Re: TaskManager

2011-07-08 Thread Patricia Shanahan
On 7/7/2011 2:26 PM, Mike Sobolewski wrote: I'm curious about why the load factor option is desirable. Suppose you have 30 tasks waiting, and you have could afford 30 threads for the function, then why not allow 30 threads? The load factor has the effect of limiting the throughput even when you

Re: TaskManager

2011-07-07 Thread Mike Sobolewski
can be handled by smaller number of > threads with no need to create additional many threads for a short > moment and release them after that temporary peak over and over. On Jul 7, 2011, at 4:

Re: TaskManager

2011-07-07 Thread Patricia Shanahan
Generally, tasks in the same TaskManager instance were all created by the same object, and their class is, or could be, an inner class in that object, and therefore they *could* talk to each through methods in that object. I'm not sure the current runAfter mechanism is right for all the us

Re: TaskManager

2011-07-07 Thread Gregg Wonderly
c void failed( Throwable ex, Object dependent ); } Gregg On 6/26/2011 3:23 PM, Peter Firmstone wrote: There's an interesting thread of discussion in the Porter mail archive that Mark has uploaded for us (see River-311), relating to the TaskManager. Here's a very interesting comment from Bob

incubator mail archive - was: Re: TaskManager

2011-07-05 Thread Zsolt Kúti
On Wed, 29 Jun 2011 10:06:02 -0400 "Christopher Dolan" wrote: > P.S. can someone add a link to the Incubator mail archives to the web > page? They are quite hard to find... > http://mail-archives.apache.org/mod_mbox/incubator-river-dev/ > http://mail-archives.apache.org/mod_mbox/incubator-riv

Re: TaskManager

2011-07-05 Thread Patricia Shanahan
The different thread pool implementations allow different constructor parameters. Perhaps a factory pattern? I think it would make run time selection of an alternative implementation easier, but make it harder for a class to specify parameters. On the other hand, I'm not sure how informed and

Re: TaskManager

2011-07-05 Thread Tom Hobbs
Would it be possible t extract the whole thing into an interface? Have the river default implementation something similar to what we have now (at least in behaviour if not implementation) but allow users to swap in their own task execution implementations that may or may not throttle in some way.

Re: TaskManager

2011-07-01 Thread Patricia Shanahan
On 7/1/2011 1:14 PM, Gregg Wonderly wrote: ... If the system throughput is not meeting my needs, I'll apply admission controls, or "add hardware" to manage the issue. Anything else done by river only serves as a "limit" that can be very frustrating to debug and deal with. I would like to make a

Re: TaskManager

2011-07-01 Thread Gregg Wonderly
nable chance at throughput. Equally a vast majority of tasks can only have a reasonable chance of throughput in the presence of sufficient resource. The point of TaskManager is to control resource consumption (including processor utilisation) which naturally asserts a limit on throughput. ...

Re: TaskManager

2011-07-01 Thread Dan Creswell
er-load so needs admission control etc to make that >> stick). >> >>> I don't like this thought at all in a distributed system.  A vast >>> majority >>> of tasks really need to be invoked immediately to maintain a reasonable >>> chance at through

Re: TaskManager

2011-07-01 Thread Patricia Shanahan
jority of tasks can only have a reasonable chance of throughput in the presence of sufficient resource. The point of TaskManager is to control resource consumption (including processor utilisation) which naturally asserts a limit on throughput. ... Some resource limitation is definitely necessary

Re: TaskManager

2011-06-30 Thread Dan Creswell
he maximum number of threads, but can equally well >> be set to have up to Integer.MAX_VALUE threads, effectively unlimited. > > Yes, this is the case.  There are some other subtle behaviors which we just > need to study to make sure that the "documented behavior" is what we ne

Re: TaskManager

2011-06-30 Thread Gregg Wonderly
UE threads, effectively unlimited. Yes, this is the case. There are some other subtle behaviors which we just need to study to make sure that the "documented behavior" is what we need. There are two forms of TaskManager behavior that I do not see an easy way to reproduce using a simpl

Re: TaskManager

2011-06-30 Thread Patricia Shanahan
o forms of TaskManager behavior that I do not see an easy way to reproduce using a simple ThreadPoolExecutor, runAfter and loadLevel. runAfter my be better handled by the class issuing the tasks. loadLevel permits specification of a ratio between threads and tasks, so that threads are only created

RE: TaskManager

2011-06-29 Thread Christopher Dolan
g/mod_mbox/incubator-river-user/ http://mail-archives.apache.org/mod_mbox/incubator-river-commits/ -Original Message- From: Peter Firmstone [mailto:j...@zeus.net.au] Sent: Sunday, June 26, 2011 5:18 PM To: dev@river.apache.org Subject: Re: TaskManager > I think the way to look at this

Re: TaskManager

2011-06-26 Thread Peter
; > > > > We are now committed to 1.5, so if we did not have runAfter we could > > > replace TaskManager with java.util.concurrent.ThreadPoolExecutor. > > > > That's probably where we should be headed, since it reduces our > > maintenance burden. > >

Re: TaskManager

2011-06-26 Thread Patricia Shanahan
, so if we did not have runAfter we could replace TaskManager with java.util.concurrent.ThreadPoolExecutor. That's probably where we should be headed, since it reduces our maintenance burden. It's also a direction that suggests an easy step-wise route from here to there. I propos

Re: TaskManager

2011-06-26 Thread Peter Firmstone
replace TaskManager with java.util.concurrent.ThreadPoolExecutor. That's probably where we should be headed, since it reduces our maintenance burden. Peter.

Re: TaskManager

2011-06-26 Thread Patricia Shanahan
On 6/26/2011 1:58 PM, Peter Firmstone wrote: Patricia Shanahan wrote: On 6/26/2011 1:23 PM, Peter Firmstone wrote: There's an interesting thread of discussion in the Porter mail archive that Mark has uploaded for us (see River-311), relating to the TaskManager. Here's a very i

Re: TaskManager

2011-06-26 Thread Peter Firmstone
Patricia Shanahan wrote: On 6/26/2011 1:23 PM, Peter Firmstone wrote: There's an interesting thread of discussion in the Porter mail archive that Mark has uploaded for us (see River-311), relating to the TaskManager. Here's a very interesting comment from Bob Scheifler: Over the y

Re: TaskManager

2011-06-26 Thread Patricia Shanahan
On 6/26/2011 1:23 PM, Peter Firmstone wrote: There's an interesting thread of discussion in the Porter mail archive that Mark has uploaded for us (see River-311), relating to the TaskManager. Here's a very interesting comment from Bob Scheifler: Over the years we've been slowly

TaskManager

2011-06-26 Thread Peter Firmstone
There's an interesting thread of discussion in the Porter mail archive that Mark has uploaded for us (see River-311), relating to the TaskManager. Here's a very interesting comment from Bob Scheifler: Over the years we've been slowly eliminating use of Task.runAfter, and in a