You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Philipp Koch (JIRA)" <ji...@apache.org> on 2007/11/02 20:56:50 UTC

[jira] Created: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

persisted timed events should be removed from the repository after they got successfully executed
-------------------------------------------------------------------------------------------------

                 Key: SLING-96
                 URL: https://issues.apache.org/jira/browse/SLING-96
             Project: Sling
          Issue Type: Bug
          Components: Event
            Reporter: Philipp Koch
            Priority: Minor


the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540149 ] 

Carsten Ziegeler commented on SLING-96:
---------------------------------------

There is a clean up thread which by default should delete old events every 30 minutes - currently this method (cleanUpRepository) is not implemented yet :(
But even without cleanup it should be possible to fire an event with the same id - the old should be overwritten. If you experience problems with this, please let me know.

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540175 ] 

Carsten Ziegeler commented on SLING-96:
---------------------------------------

Yes, I think there are two use cases:
a) updating timed events (regardless if they are scheduled for a fixed date or periodically) - the idea is to delete the event with the given id first and then recreate it with the same id; I think this is the cleanest way of updating, especially in a clustered environment.
b) creating a timed event with the same id for a fixed date, where the old timed event with the same id has already been expired - in this case this should work without deleting/recreating; I'm currently working on a fix for this.

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler reassigned SLING-96:
-------------------------------------

    Assignee: Carsten Ziegeler

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Philipp Koch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540171 ] 

Philipp Koch commented on SLING-96:
-----------------------------------

>I guess that your use case is to have timed events that are not scheduled periodically but fired once on a fixed date, right?
yes. but it might happen that the (fixed) date needs to be updated. so updating the timed event would be nice :-). the workaround would be to delete the event with the given id and recreate the event with the same id - right?

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Philipp Koch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540201 ] 

Philipp Koch commented on SLING-96:
-----------------------------------

well i missed to update the modified node types in my repo. this was the reason that nothing worked at all. what's working again (now):
- register timed event with a given id
- "reregister" timed event with the same id (event got already processed)

what's still not working:
- update a timed event: 05.11.2007 16:05:48 *ERROR* o.a.s.e.i.TimedEventHandler: Timed event is already scheduled: sms (TimedEvent: sms::/smsdemo/events/abfall/kreis1/05.11.2007_5)

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Philipp Koch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540198 ] 

Philipp Koch commented on SLING-96:
-----------------------------------

i created a new timed event. then i updated the timed event. following error got thrown:
05.11.2007 15:30:57 *ERROR* o.a.s.e.i.TimedEventHandler: Exception during writing new job to repository.
javax.jcr.InvalidItemStateException: Unable to unlock node. Node has pending changes: /sling/timed-events
	at com.day.crx.core.NodeImpl.unlock(NodeImpl.java:4097)
	at org.apache.jackrabbit.util.Locked.runAndUnlock(Locked.java:234)
	at org.apache.jackrabbit.util.Locked.with(Locked.java:148)
	at org.apache.jackrabbit.util.Locked.with(Locked.java:104)
	at org.apache.sling.event.impl.TimedEventHandler.persistEvent(TimedEventHandler.java:172)
	at org.apache.sling.event.impl.TimedEventHandler.runInBackground(TimedEventHandler.java:127)
	at org.apache.sling.event.impl.AbstractRepositoryEventHandler$1.run(AbstractRepositoryEventHandler.java:114)
05.11.2007 15:31:19 *ERROR* o.a.s.e.i.TimedEventHandler: Exception during writing new job to repository.
javax.jcr.InvalidItemStateException: Unable to lock node. Node has pending changes: /sling/timed-events
	at com.day.crx.core.NodeImpl.lock(NodeImpl.java:4032)
	at org.apache.jackrabbit.util.Locked.tryLock(Locked.java:252)
	at org.apache.jackrabbit.util.Locked.with(Locked.java:146)
	at org.apache.jackrabbit.util.Locked.with(Locked.java:104)
	at org.apache.sling.event.impl.TimedEventHandler.persistEvent(TimedEventHandler.java:172)
	at org.apache.sling.event.impl.TimedEventHandler.runInBackground(TimedEventHandler.java:127)
	at org.apache.sling.event.impl.AbstractRepositoryEventHandler$1.run(AbstractRepositoryEventHandler.java:114)

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-96.
---------------------------------

    Resolution: Fixed

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Philipp Koch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540161 ] 

Philipp Koch commented on SLING-96:
-----------------------------------

when fireing an event with the same id (previous event  got processed) i get following error msg:
05.11.2007 10:36:34 *ERROR* o.a.s.e.i.TimedEventHandler: Timed event is already scheduled: sms (TimedEvent: sms::/smsdemo/events/abfall/kreis1/02.11.2007_9).

the consequence of this is that the event is not processed.

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540191 ] 

Carsten Ziegeler commented on SLING-96:
---------------------------------------

I've commited a fix for the update problem.

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540210 ] 

Carsten Ziegeler commented on SLING-96:
---------------------------------------

Some synchronization for the removal was missing and the wrong session was used. I fixed this in latest svn.

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540158 ] 

Carsten Ziegeler commented on SLING-96:
---------------------------------------

There is at least one bug in the implementation:
If a scheduled event is stopped, it does neither get removed from the repository or get marked in the repository as stopped. On a restart this timed event might be started again.

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540169 ] 

Carsten Ziegeler commented on SLING-96:
---------------------------------------

Ups, you're right - there is a nice comment in the code:

                        // node is already in repository, this is an error as we don't support updates
                        // of timed events!

I guess that your use case is to have timed events that are not scheduled periodically but fired once on a fixed date, right?

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SLING-96) persisted timed events should be removed from the repository after they got successfully executed

Posted by "Philipp Koch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540199 ] 

Philipp Koch commented on SLING-96:
-----------------------------------

even if i create  anew timed event i get following exception which is thrown when the event is processed(note: i did restart sling and the repository before):
05.11.2007 15:39:11 *ERROR* o.a.s.e.i.TimedEventHandler: Exception during writing new job to repository.
javax.jcr.InvalidItemStateException: Unable to unlock node. Node has pending changes: /sling/timed-events
	at com.day.crx.core.NodeImpl.unlock(NodeImpl.java:4097)
	at org.apache.jackrabbit.util.Locked.runAndUnlock(Locked.java:234)
	at org.apache.jackrabbit.util.Locked.with(Locked.java:148)
	at org.apache.jackrabbit.util.Locked.with(Locked.java:104)
	at org.apache.sling.event.impl.TimedEventHandler.persistEvent(TimedEventHandler.java:172)
	at org.apache.sling.event.impl.TimedEventHandler.runInBackground(TimedEventHandler.java:127)
	at org.apache.sling.event.impl.AbstractRepositoryEventHandler$1.run(AbstractRepositoryEventHandler.java:114)

> persisted timed events should be removed from the repository after they got successfully executed
> -------------------------------------------------------------------------------------------------
>
>                 Key: SLING-96
>                 URL: https://issues.apache.org/jira/browse/SLING-96
>             Project: Sling
>          Issue Type: Bug
>          Components: Event
>            Reporter: Philipp Koch
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>
> the persisted timed events keep staying in the repository also after being executed/fired successfully. this is from my point of view not correct. the nodes should be deleted so that it would be possible to register a timed event again with the same id. if the current behaviour is thought to keep kind of a history than it would make more sense to keep such a history in a "history" tree.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.