Details
-
Bug
-
Status: Resolved
-
P1
-
Resolution: Fixed
-
None
-
None
Description
StreamingDataflowWorker keeps a map of finalization callbacks (https://github.com/apache/beam/blob/master/runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java#L401). If the Dataflow service loses a callback ID (due to autoscaling etc; they are best-effort), the callback will stay around forever.
This can cause a relatively rapid memory leak for sources like KafkaIO where the callback (the KafkaCheckpointMark) has a reference to the KafkaUnboundedReader object, which keeps a KafkaConsumer object alive.
A simple fix would be to change the ConcurrentHashMap to a guava Cache with a timeout on elements.
Attachments
Issue Links
- links to