Skip to content

x/playground: exec.CommandContext(...).Run() does not honor context timeout #38855

Closed
@hlin117

Description

@hlin117

What version of Go are you using (go version)?

1.14.2, as stated on the Go Playground (as of May 4th, 2020).

Does this issue reproduce with the latest release?

Yes, 1.14.2 is the latest release.

What operating system and processor architecture are you using (go env)?

Environment is the Go Playground.

Note that I cannot reproduce this error on my 2019 Macbook, running 1.14.2.

What did you do?

I ran the demo on the Go documentation with os/exec:CommandContext, I discovered that the timeout example seemed to have strange behavior.

Screen Shot 2020-05-04 at 11 09 33 AM

It seemed the demo was hitting the timeout limit of the Go Playground, ignoring the 100ms context timeout.

Modifying the demo a little bit, I discovered that the timeout on the Go Playground was being ignored completely. See below screenshot.

Screen Shot 2020-05-04 at 11 13 06 AM

See Go Playground link: https://play.golang.org/p/ckZbgZ7n1tM

What did you expect to see?

The 100ms timeout from the context should have been honored when running exec.CommandContext(...). It seems based on #21880 and me running the demo on my laptop that this behavior worked in previous releases, and this bug might exist on different environments.

What did you see instead?

The 100ms timeout is being ignored on the Go Playground environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions