This is an automated email from the ASF dual-hosted git repository.
bharathkk pushed a commit to branch 1.4.0
in repository https://gitbox.apache.org/repos/asf/samza.git
The following commit(s) were added to refs/heads/1.4.0 by this push:
new 3ef1c67 SAMZA-2463: Duplicate firings of processing timers (#1282)
3ef1c67 is described below
commit 3ef1c67d9ee46aab933e659a07c7d7dd4605a815
Author: mynameborat <[email protected]>
AuthorDate: Wed Feb 19 13:42:08 2020 -0800
SAMZA-2463: Duplicate firings of processing timers (#1282)
Remove the keys from the local book keeping map directly instead of using
the keySet and removeAll
---
.../main/java/org/apache/samza/scheduler/EpochTimeScheduler.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
a/samza-core/src/main/java/org/apache/samza/scheduler/EpochTimeScheduler.java
b/samza-core/src/main/java/org/apache/samza/scheduler/EpochTimeScheduler.java
index ddc5b29..cbebbde 100644
---
a/samza-core/src/main/java/org/apache/samza/scheduler/EpochTimeScheduler.java
+++
b/samza-core/src/main/java/org/apache/samza/scheduler/EpochTimeScheduler.java
@@ -90,7 +90,11 @@ public class EpochTimeScheduler {
public Map<TimerKey<?>, ScheduledCallback> removeReadyTimers() {
final Map<TimerKey<?>, ScheduledCallback> timers = new
TreeMap<>(readyTimers);
- readyTimers.keySet().removeAll(timers.keySet());
+ // Remove keys on the map directly instead of using key set iterator and
remove all
+ // on the key set as it results in duplicate firings due to weakly
consistent SetView
+ for (TimerKey<?> key : timers.keySet()) {
+ readyTimers.remove(key);
+ }
return timers;
}