[go] runtime: ignore EAGAIN from exec in TestCgoExecSignalMask

15 views
Skip to first unread message

Ian Lance Taylor (Gerrit)

unread,
Sep 18, 2018, 10:58:55 AM9/18/18
to Michael Munday, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Ian Lance Taylor would like Michael Munday to review this change.

View Change

runtime: ignore EAGAIN from exec in TestCgoExecSignalMask

Fixes #27731

Change-Id: Ifb4d57923b1bba0210ec1f623d779d7b5f442812
---
M src/runtime/testdata/testprogcgo/exec.go
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/runtime/testdata/testprogcgo/exec.go b/src/runtime/testdata/testprogcgo/exec.go
index 2e94840..94da5dc 100644
--- a/src/runtime/testdata/testprogcgo/exec.go
+++ b/src/runtime/testdata/testprogcgo/exec.go
@@ -75,6 +75,14 @@
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
+ // An overloaded system
+ // may fail with EAGAIN.
+ // This doesn't tell us
+ // anything useful; ignore it.
+ // Issue #27731.
+ if isEAGAIN(err) {
+ return
+ }
fmt.Printf("iteration %d: %v\n", j, err)
os.Exit(1)
}
@@ -87,3 +95,11 @@

fmt.Println("OK")
}
+
+// isEAGAIN reports whether err is an EAGAIN error from a process execution.
+func isEAGAIN(err error) bool {
+ if p, ok := err.(*os.PathError); ok {
+ err = p.Err
+ }
+ return err == syscall.EAGAIN
+}

To view, visit change 135995. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ifb4d57923b1bba0210ec1f623d779d7b5f442812
Gerrit-Change-Number: 135995
Gerrit-PatchSet: 1
Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
Gerrit-Reviewer: Michael Munday <mike....@ibm.com>
Gerrit-MessageType: newchange

Gobot Gobot (Gerrit)

unread,
Sep 18, 2018, 10:59:05 AM9/18/18
to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Michael Munday, golang-co...@googlegroups.com

TryBots beginning. Status page: https://farmer.golang.org/try?commit=d74c3db1

View Change

    To view, visit change 135995. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ifb4d57923b1bba0210ec1f623d779d7b5f442812
    Gerrit-Change-Number: 135995
    Gerrit-PatchSet: 1
    Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Reviewer: Michael Munday <mike....@ibm.com>
    Gerrit-CC: Gobot Gobot <go...@golang.org>
    Gerrit-Comment-Date: Tue, 18 Sep 2018 14:59:03 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Michael Munday (Gerrit)

    unread,
    Sep 18, 2018, 11:06:15 AM9/18/18
    to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Gobot Gobot, golang-co...@googlegroups.com

    LGTM. I do wonder if we should put some resilience to EAGAIN into syscall.StartProcess though, given that there isn't an obvious way to detect temporary errors when using the os package.

    View Change

      To view, visit change 135995. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ifb4d57923b1bba0210ec1f623d779d7b5f442812
      Gerrit-Change-Number: 135995
      Gerrit-PatchSet: 1
      Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Reviewer: Michael Munday <mike....@ibm.com>
      Gerrit-CC: Gobot Gobot <go...@golang.org>
      Gerrit-Comment-Date: Tue, 18 Sep 2018 15:06:12 +0000

      Michael Munday (Gerrit)

      unread,
      Sep 18, 2018, 11:06:24 AM9/18/18
      to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Gobot Gobot, golang-co...@googlegroups.com

      Patch set 1:Code-Review +2

      View Change

        To view, visit change 135995. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ifb4d57923b1bba0210ec1f623d779d7b5f442812
        Gerrit-Change-Number: 135995
        Gerrit-PatchSet: 1
        Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Michael Munday <mike....@ibm.com>
        Gerrit-CC: Gobot Gobot <go...@golang.org>
        Gerrit-Comment-Date: Tue, 18 Sep 2018 15:06:21 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        Gerrit-MessageType: comment

        Gobot Gobot (Gerrit)

        unread,
        Sep 18, 2018, 11:07:04 AM9/18/18
        to Ian Lance Taylor, goph...@pubsubhelper.golang.org, Michael Munday, golang-co...@googlegroups.com

        TryBots are happy.

        Patch set 1:TryBot-Result +1

        View Change

          To view, visit change 135995. To unsubscribe, or for help writing mail filters, visit settings.

          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ifb4d57923b1bba0210ec1f623d779d7b5f442812
          Gerrit-Change-Number: 135995
          Gerrit-PatchSet: 1
          Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Reviewer: Michael Munday <mike....@ibm.com>

          Ian Lance Taylor (Gerrit)

          unread,
          Sep 18, 2018, 11:16:09 AM9/18/18
          to goph...@pubsubhelper.golang.org, Gobot Gobot, Michael Munday, golang-co...@googlegroups.com

          LGTM. I do wonder if we should put some resilience to EAGAIN into syscall.StartProcess though, given that there isn't an obvious way to detect temporary errors when using the os package.

          I would be reluctant to change the syscall package. I think the syscall package should try to put as little as possible between the system and the program. We could consider doing it in the os package, but, since this problem presumably only occurs when the system is overloaded in some way, I would be concerned that retrying would just make the problem worse.

          View Change

            To view, visit change 135995. To unsubscribe, or for help writing mail filters, visit settings.

            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Ifb4d57923b1bba0210ec1f623d779d7b5f442812
            Gerrit-Change-Number: 135995
            Gerrit-PatchSet: 1
            Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Reviewer: Michael Munday <mike....@ibm.com>
            Gerrit-Comment-Date: Tue, 18 Sep 2018 15:16:07 +0000

            Ian Lance Taylor (Gerrit)

            unread,
            Sep 18, 2018, 11:16:17 AM9/18/18
            to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Gobot Gobot, Michael Munday, golang-co...@googlegroups.com

            Ian Lance Taylor merged this change.

            View Change

            Approvals: Michael Munday: Looks good to me, approved Ian Lance Taylor: Run TryBots Gobot Gobot: TryBots succeeded
            runtime: ignore EAGAIN from exec in TestCgoExecSignalMask

            Fixes #27731

            Change-Id: Ifb4d57923b1bba0210ec1f623d779d7b5f442812
            Reviewed-on: https://go-review.googlesource.com/135995
            Run-TryBot: Ian Lance Taylor <ia...@golang.org>
            Reviewed-by: Michael Munday <mike....@ibm.com>
            TryBot-Result: Gobot Gobot <go...@golang.org>
            Gerrit-PatchSet: 2
            Gerrit-Owner: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Reviewer: Gobot Gobot <go...@golang.org>
            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Reviewer: Michael Munday <mike....@ibm.com>
            Gerrit-MessageType: merged
            Reply all
            Reply to author
            Forward
            0 new messages