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

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

                Author: ASF GitHub Bot
            Created on: 29/Jul/18 17:47
            Start Date: 29/Jul/18 17:47
    Worklog Time Spent: 10m 
      Work Description: reuvenlax closed pull request #6075: [BEAM-5028] 
Finalize writes before returning filenames via WriteFileResults
URL: https://github.com/apache/beam/pull/6075
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/WriteFiles.java 
b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/WriteFiles.java
index 7c16eed5ef9..c6d2d11025e 100644
--- a/sdks/java/core/src/main/java/org/apache/beam/sdk/io/WriteFiles.java
+++ b/sdks/java/core/src/main/java/org/apache/beam/sdk/io/WriteFiles.java
@@ -794,11 +794,11 @@ public void process(ProcessContext c) throws Exception {
                 ? writeOperation.finalizeDestination(
                     defaultDest, GlobalWindow.INSTANCE, fixedNumShards, 
fileResults)
                 : finalizeAllDestinations(fileResults, fixedNumShards);
+        writeOperation.moveToOutputFiles(resultsToFinalFilenames);
         for (KV<FileResult<DestinationT>, ResourceId> entry : 
resultsToFinalFilenames) {
           FileResult<DestinationT> res = entry.getKey();
           c.output(KV.of(res.getDestination(), entry.getValue().toString()));
         }
-        writeOperation.moveToOutputFiles(resultsToFinalFilenames);
       }
     }
   }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 128568)
    Time Spent: 0.5h  (was: 20m)

> getPerDestinationOutputFilenames() is getting processed before write is 
> finished
> --------------------------------------------------------------------------------
>
>                 Key: BEAM-5028
>                 URL: https://issues.apache.org/jira/browse/BEAM-5028
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-files
>    Affects Versions: 2.5.0
>            Reporter: Jozef Vilcek
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> I believe I am hitting a race condition on finalising writes vs notification 
> events about frites being done.
> It looks to me that WriteFilesResult.getPerDestinationOutputFilenames() can 
> announce files before they are finished:
> [https://github.com/apache/beam/blob/release-2.5.0/sdks/java/core/src/main/java/org/apache/beam/sdk/io/WriteFiles.java#L799]
> This is related to BEAM-3268 where it appears to not be fully fixed.



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

Reply via email to