I like the proposal and I think it's very important/useful. I would suggest though to not use a hard-coded expiration mechanism and instead use a leasing mechanism. I propose that a task says it needs the lock for X number of minutes/hours and writes the time it started and the lease amount. It just a subtle tweak, but it optimizes the scheduling a bit, so a quick task like saving referrers can get a 3-min lease and not block 3 hours of thread time. Additionally, they could store the name of the task, so parallel tasks can work w/o blocking each other and only tasks with the same service name wait on each other. Obviously, a task can extend their lease if needed to run for more time.
For example, let's store this as the property: task.indexing value: 12:00:01,3mins In other words, let's re-invent JINI. -Elias Allen Gilliland wrote: > This is a really short one, but I did a proposal anyways. I'd like to > add a simple locking mechanism to the various background tasks that we > have so that running them in clustered environments is safe from > synchronization issues and we can prevent a task from running at the > same time on multiple machines in the cluster. > > http://rollerweblogger.org/wiki/Wiki.jsp?page=Proposal_ClusteredTasksViaLocking > > > Since this is such a short proposal I'd like to go ahead and propose a > vote on the proposal as is, since I don't expect there is a need for > lots of discussion. This would go into Roller 3.1. > > -- Allen >
