[
https://issues.apache.org/jira/browse/BEAM-6164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Brampton resolved BEAM-6164.
-----------------------------------
Resolution: Fixed
Fix Version/s: 2.9.1
With [https://github.com/apache/beam/pull/7182] and
[https://github.com/apache/beam/pull/7292] this is now fixed.
> 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)