[ 
https://issues.apache.org/jira/browse/BEAM-7442?focusedWorklogId=251743&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-251743
 ]

ASF GitHub Bot logged work on BEAM-7442:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 31/May/19 12:06
            Start Date: 31/May/19 12:06
    Worklog Time Spent: 10m 
      Work Description: JozoVilcek commented on pull request #8715: 
[BEAM-7442][BEAM-5650] Read sequentially from bounded sources in 
UnboundedSourceWrapper
URL: https://github.com/apache/beam/pull/8715#discussion_r289360958
 
 

 ##########
 File path: 
runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/UnboundedSourceWrapper.java
 ##########
 @@ -217,34 +227,33 @@ public void 
run(SourceContext<WindowedValue<ValueWithRecordId<OutputT>>> ctx) th
       // through to idle this executor.
       LOG.info("Number of readers is 0 for this task executor, idle");
       // Do nothing here but still execute the rest of the source logic
-    } else if (localReaders.size() == 1) {
-      // the easy case, we just read from one reader
-      UnboundedSource.UnboundedReader<OutputT> reader = localReaders.get(0);
-
-      synchronized (ctx.getCheckpointLock()) {
-        boolean dataAvailable = readerInvoker.invokeStart(reader);
-        if (dataAvailable) {
-          emitElement(ctx, reader);
-        }
-      }
-
+    } else if (isConvertedBoundedSource) {
       setNextWatermarkTimer(this.runtimeContext);
 
-      while (isRunning) {
-        boolean dataAvailable;
-        synchronized (ctx.getCheckpointLock()) {
-          dataAvailable = readerInvoker.invokeAdvance(reader);
+      // We read sequentially from all bounded sources
 
 Review comment:
   Cool. Thanks for the reference
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 251743)
    Time Spent: 1.5h  (was: 1h 20m)

> Bounded Reads for Flink Runner fails with OOM
> ---------------------------------------------
>
>                 Key: BEAM-7442
>                 URL: https://issues.apache.org/jira/browse/BEAM-7442
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-flink
>            Reporter: Akshay Iyangar
>            Assignee: Akshay Iyangar
>            Priority: Major
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> When Flink runner is reading from a bounded source and if the total number of 
> files are huge and the count is more. FlinkRunner throws an OOM error. This 
> is happening because the current implementation doesn't read them 
> sequentially but simultaneously thus causing all of the files to be in memory 
> which quickly breaks the cluster.
> Solution : To wrap `UnboundedReadFromBoundedSource` class by a wrapper to see 
> that when the stream is a bounded source we make it read it sequentially 
> using a queue.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to