Don't leak garbage collection timers in GlobalWindow
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
Consider the transform:
Window
.into(new GlobalWindows())
.triggering(
Repeatedly.forever(
AfterProcessingTime.pastFirstElementInPane().plusDelayOf(...)))
.discardingFiredPanes()
This is a common idiom for 'process elements bunched by arrival time'.
Currently we create an end-of-window timer per key, which clearly will only fire if the pipeline is drained.
Better would be to avoid creating end-of-window timers if there's no state which needs to be processed at end-of-window (ie at drain if the Global window).
Imported from Jira [BEAM-175](https://issues.apache.org/jira/browse/BEAM-175). Original Jira may contain additional context.
Reported by: mshields822.
Contributor guide
Research direction
The issue names GlobalWindow/GlobalWindows, Repeatedly, AfterProcessingTime, and end-of-window timers, but no source file or test. Start by tracing how these windowing and trigger components create timers for each key, then verify the arrival-time pattern does not retain unnecessary end-of-window timers while still handling state that must be processed at window end.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- data-engineering, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100