[
https://issues.apache.org/jira/browse/S4-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13761466#comment-13761466
]
Kurtt.Lin commented on S4-142:
------------------------------
This issue is spotted by my colleague Zhen Dong.
I shall summit a patch as long as this is confirmed.
> Deep cloning for triggers is needed upon a new PE instance’s creation
> ---------------------------------------------------------------------
>
> Key: S4-142
> URL: https://issues.apache.org/jira/browse/S4-142
> Project: Apache S4
> Issue Type: Bug
> Affects Versions: 0.6
> Reporter: Kurtt.Lin
> Fix For: 0.7
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> The createPE(String id) method in ProcessingElement returns a cloned instance
> of the prototype. However, the way an instance's triggers map is cloned is
> incorrect:
> bq. pe.triggers = Maps.newHashMap(triggers);
> It's a shallow cloning; every instance shares the same trigger for a certain
> event type.
> Or, if the eventCount/lastTime in a trigger is shared across the instances by
> design, then checkAndUpdate() should be guarded to prevent parallel writing.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira