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

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

                Author: ASF GitHub Bot
            Created on: 14/Apr/20 18:40
            Start Date: 14/Apr/20 18:40
    Worklog Time Spent: 10m 
      Work Description: lostluck commented on pull request #11413: [BEAM-9746] 
check for 0 length copies from state
URL: https://github.com/apache/beam/pull/11413#discussion_r408354342
 
 

 ##########
 File path: sdks/go/pkg/beam/core/runtime/harness/datamgr.go
 ##########
 @@ -369,11 +371,14 @@ func (r *dataReader) Read(buf []byte) (int, error) {
                r.cur = b
        }
 
+       // We don't need to check for a 0 length copy from r.cur here, since 
that's
+       // checked before buffers are handed to the r.buf channel.
        n := copy(buf, r.cur)
 
-       if len(r.cur) == n {
+       switch {
 
 Review comment:
   It could but I like the consistency in handling between the statemgr and 
datamgr code, hence the no-op/comment only change.
 
----------------------------------------------------------------
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: 422227)
    Time Spent: 40m  (was: 0.5h)

> [Go SDK] Empty side inputs causing spurious zero elements
> ---------------------------------------------------------
>
>                 Key: BEAM-9746
>                 URL: https://issues.apache.org/jira/browse/BEAM-9746
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-go
>            Reporter: Robert Burke
>            Assignee: Robert Burke
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> A user discovered that empty side inputs would spuriously provide a single 
> zero element.
> The error was narrowed down to the Go SDK's state manager codeĀ  copying the 
> stateGetResponse data wasn't checking that the original data source even had 
> any bytes in it, leading it in particular to interpret length prefixed data 
> as having 0 length, which would cause zero value elements to be generated. 
> Notably, this caused empty strings.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to