You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Carsten Ziegeler <cz...@apache.org> on 2013/04/26 09:10:26 UTC

Updates to the Sling Event Bundle

Hi,

I've done some substantial changes to the Sling event bundle. I've moved
all the code to the resource API, leveraging the CRUD stuff. While this
lead to cleaner/simpler code, it also revealed some bugs/problems with the
jcr resource bundle.

But the biggest change is leveraging the new discovery API which allows to
know the instances in the topology, the capabilities of an instance and act
on changes thereof. The discovery API also does a leader election, so there
is one dedicated instance which can be used for things that really should
only run on a single instance.
I've updated all parts of the event bundle, job handling, timed job events
and distributed events, to use this new feature.

I've also looked at the configuration and reduced the metatype information
to those settings which are really meant to be changed. So there are less
options visibile in tools like the web console whle of course still the
same set of configuration properties is supported. For example the resource
path where jobs are stored is configurable but there is rarely a need to
change this. Therefore no metatype information is generated for this
anymore. But as said, the configuration is compatible to previous versions.

And last but not least, I've also added a new API for starting a job and a
new interface for processing the job. The old implementations leveraged the
event admin for both parts which adds a little bit of uncertainty to
creating and processing the jobs. With the new service based API we have
more stable contracts. Of course the old way is still supported.

Regards
Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Updates to the Sling Event Bundle

Posted by Carsten Ziegeler <cz...@apache.org>.
Hi,

I guess we'll have more tests over time, and yes, I plan to update the
documentation as the current one is really very very old :)

Regards
Carsten


2013/4/26 Stefan Egli <eg...@adobe.com>

> Hi Bertrand,
>
> On 4/26/13 12:24 PM, "Bertrand Delacretaz" <bd...@apache.org> wrote:
>
> >Hi Carsten,
> >
> >On Fri, Apr 26, 2013 at 9:10 AM, Carsten Ziegeler <cz...@apache.org>
> >wrote:
> >> ...The discovery API also does a leader election, so there
> >> is one dedicated instance which can be used for things that really
> >>should
> >> only run on a single instance...
> >
> >Are you confident that the ClusterView's "every ClusterView is
> >guaranteed to have one and only one leader" invariant is adequately
> >covered by the existing tests?
> >
> >Or are you planning more testing to simulate edge cases like timeouts,
> >intermittent disconnects, PersistenceException etc? A quick look at
> >the tests seems to indicate that they test happy cases so far - but
> >maybe I missed something.
>
> +1 for more testing to come. The current state of the tests is indeed
> rather on the happy side of things and more disaster cases should be added.
>
> Cheers,
> Stefan
>
>


-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Updates to the Sling Event Bundle

Posted by Stefan Egli <eg...@adobe.com>.
Hi Bertrand,

On 4/26/13 12:24 PM, "Bertrand Delacretaz" <bd...@apache.org> wrote:

>Hi Carsten,
>
>On Fri, Apr 26, 2013 at 9:10 AM, Carsten Ziegeler <cz...@apache.org>
>wrote:
>> ...The discovery API also does a leader election, so there
>> is one dedicated instance which can be used for things that really
>>should
>> only run on a single instance...
>
>Are you confident that the ClusterView's "every ClusterView is
>guaranteed to have one and only one leader" invariant is adequately
>covered by the existing tests?
>
>Or are you planning more testing to simulate edge cases like timeouts,
>intermittent disconnects, PersistenceException etc? A quick look at
>the tests seems to indicate that they test happy cases so far - but
>maybe I missed something.

+1 for more testing to come. The current state of the tests is indeed
rather on the happy side of things and more disaster cases should be added.

Cheers,
Stefan


Re: Updates to the Sling Event Bundle

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Carsten,

On Fri, Apr 26, 2013 at 9:10 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> ...The discovery API also does a leader election, so there
> is one dedicated instance which can be used for things that really should
> only run on a single instance...

Are you confident that the ClusterView's "every ClusterView is
guaranteed to have one and only one leader" invariant is adequately
covered by the existing tests?

Or are you planning more testing to simulate edge cases like timeouts,
intermittent disconnects, PersistenceException etc? A quick look at
the tests seems to indicate that they test happy cases so far - but
maybe I missed something.

-Bertrand

Re: Updates to the Sling Event Bundle

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Carsten,

On Fri, Apr 26, 2013 at 9:10 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> ...the biggest change is leveraging the new discovery API which allows to
> know the instances in the topology, the capabilities of an instance and act
> on changes thereof...

Are you going to update the website docs to reflect that?

I think at least marking the parts that are obsolete/changed would be
good, if you don't have time to fully update the docs right now.

Note that http://sling.apache.org/site/eventing-and-jobs.html is still
around, should be removed as per SLING-2002 if you review the new
http://sling.apache.org/documentation/the-sling-engine/eventing-and-jobs.html

-Bertrand