Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Early Throttling by Adding Timestamp Check to Throttling Logic and Refine Throttling Related Unit Tests #12696

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ protected void process(ComplexEventChunk<StreamEvent> streamEventChunk, Processo
StreamEventCloner streamEventCloner, ComplexEventPopulater complexEventPopulater) {

synchronized (this) {
if (expireEventTime == -1) {
if (expireEventTime != -1) {
if (expireEventTime - timeInMilliSeconds > streamEventChunk.getLast().getTimestamp()) {
// if the event chunk is older than the current window, drop the chunk
return;
}
} else {
long currentTime = executionPlanContext.getTimestampGenerator().currentTime();
if (startTime != -1) {
expireEventTime = addTimeShift(currentTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void receive(long timeStamp, Event[] inEvents, Event[] removeEvents) {
executionPlanRuntime.start();
inputHandler.send(new Object[]{"IBM", 700f, 0});
inputHandler.send(new Object[]{"WSO2", 60.5f, 1});
Thread.sleep(260000);
Thread.sleep(121000);
inputHandler.send(new Object[]{"IBM", 700f, 0});
Assert.assertEquals(3, inEventCount);
Assert.assertTrue("Event expiry time is not valid for the current batch" , (Long) (lastCurrentEvent.getData()[3]) >= System.currentTimeMillis());
Expand Down
Loading