Andrew Brampton created BEAM-6164:
-------------------------------------

             Summary: 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


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)

Reply via email to