You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Ismaël Mejía (JIRA)" <ji...@apache.org> on 2019/01/10 14:53:00 UTC

[jira] [Commented] (BEAM-6164) GCS OpenRead and OpenWrite do not make use of the passed in context

    [ https://issues.apache.org/jira/browse/BEAM-6164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16739480#comment-16739480 ] 

Ismaël Mejía commented on BEAM-6164:
------------------------------------

Is this going to be backported somehow for 2.9.1 otherwise fix version should be 2.11.0

> GCS OpenRead and OpenWrite do not make use of the passed in context
> -------------------------------------------------------------------
>
>                 Key: BEAM-6164
>                 URL: https://issues.apache.org/jira/browse/BEAM-6164
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-go
>    Affects Versions: 2.8.0
>            Reporter: Andrew Brampton
>            Assignee: Robert Burke
>            Priority: Minor
>             Fix For: 2.9.1
>
>
> The two methods (in [gcs.go|https://github.com/apache/beam/blob/master/sdks/go/pkg/beam/io/filesystem/gcs/gcs.go])
> {code:go}
> func (f *fs) OpenRead(ctx context.Context, filename string) (io.ReadCloser, error)
> func (f *fs) OpenWrite(ctx context.Context, filename string) (io.WriteCloser, error)
> {code}
> Both accept a Context, but they do not make use of them. This makes it impossible to set Timeouts on the requests. (I learnt this the hard way, after my pipeline made no progress while blocked on GCS).
> For example, it should be common to write:
> {code:go}
> ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
> defer cancel() // Always call cancel.
> fs.OpenRead(ctx, "gs://....")
> {code}
> This may not be possible to fix given the underlying GCS library in use. BEAM-6155 would help fix this.



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