Skip to content

Conversation

dilini-muthumala
Copy link
Contributor

@dilini-muthumala dilini-muthumala commented Feb 22, 2021

Purpose

The trpProperties is set in the SourceMapper but it is removed by both SourceMapper and InputEventHandler.
For each event SourceMapper gets, it sets the trpProperties and hands over the event to InputEventHandler. After that removes the trpProperties.
For each event InputEventHandler gets, it removes the trpProperties too (it is unclear why it is doing this duplicate work).
Problem occurs when a batch of events comes to SourceMapper and it invokes the InputEventHandler multiple times (once for each event in the batch). Since InputEventHandler removes the trpProperties each time it gets an event; but the SourceMapper only sets it once for the whole batch, the 2nd event in the batch gets null for the trpProperties. This is the rootcause of this issue.

In this fix, we assume that only the SourceMapper submits events to the InputEventHandler. So setting/removal of trpProperties is handled solely by the SourceMapper.

Release note

Fixes #1719
Fixes siddhi-io/siddhi-map-json#100

Automation tests

Security checks

Fix provided by Damith Wickramasinghe
The trpProperties is set in the SourceMapper but it is removed by both SourceMapper and InputEventHandler.
For each event SourceMapper gets, it sets the trpProperties and hands over the event to InputEventHandler. After that removes the trpProperties.
For each event InputEventHandler gets, it removes the trpProperties too (it is unclear why it is doing this duplicate work).
Problem occurs when a batch of events comes to SourceMapper and it invokes the InputEventHandler multiple times (once for each event in the batch). Since InputEventHandler removes the trpProperties each time it gets an event; but the SourceMapper only sets it once for the whole batch, the 2nd event in the batch gets null for the trpProperties. This is the rootcause of this issue.

In this fix, we assume that only the SourceMapper submits events to the InputEventHandler. So setting/removal of trpProperties is handled solely by the SourceMapper.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE observed when 'event.grouping.enabled='false' Intermittent siddhi apps deployment error during server startup as a Windows service
2 participants