FAQ
https://codereview.appspot.com/6903061/diff/22002/src/cmd/go/signal.go
File src/cmd/go/signal.go (right):

https://codereview.appspot.com/6903061/diff/22002/src/cmd/go/signal.go#newcode28
src/cmd/go/signal.go:28: onceCloseInterrupted.Do(closeInterrupted)
Why do we need to keep this func running once a signal which would
interrupt the downstream process has arrived ?

https://codereview.appspot.com/6903061/

Search Discussions

  • Alex Brainman at Dec 13, 2012 at 11:47 pm
    Hello golang-dev@googlegroups.com, dave@cheney.net, rsc@golang.org (cc:
    golang-dev@googlegroups.com),

    Please take another look.


    https://codereview.appspot.com/6903061/
  • Alex Brainman at Dec 13, 2012 at 11:53 pm
    https://codereview.appspot.com/6903061/diff/22002/src/cmd/go/signal.go
    File src/cmd/go/signal.go (right):

    https://codereview.appspot.com/6903061/diff/22002/src/cmd/go/signal.go#newcode28
    src/cmd/go/signal.go:28: onceCloseInterrupted.Do(closeInterrupted)
    On 2012/12/13 23:45:54, dfc wrote:
    Why do we need to keep this func running once a signal which would
    interrupt the
    downstream process has arrived ?
    go process is ignoring these signals, so, I think, we can get second
    signal while we doing something else. We should be prepared.

    https://codereview.appspot.com/6903061/
  • Dave at Dec 13, 2012 at 11:56 pm

    go process is ignoring these signals, so, I think, we can get second signal
    while we doing something else. We should be prepared.
    ignoredSignals is maybe not accurate. The go process doesn't ignore the
    signals, in fact, it watches for them. The downstream go
    test/run/whatever process doesn't ignore them either, it reacts to them.

    Maybe s/ignored/interruptible/ then it is clearer that the func waiting
    on the sig chan closes the interrupted chan and then it is done.


    https://codereview.appspot.com/6903061/
  • Alex Brainman at Dec 14, 2012 at 12:06 am
    Hello golang-dev@googlegroups.com, dave@cheney.net, rsc@golang.org (cc:
    golang-dev@googlegroups.com),

    Please take another look.


    https://codereview.appspot.com/6903061/
  • Dave at Dec 14, 2012 at 12:16 am
    https://codereview.appspot.com/6903061/diff/29009/src/cmd/go/signal.go
    File src/cmd/go/signal.go (right):

    https://codereview.appspot.com/6903061/diff/29009/src/cmd/go/signal.go#newcode28
    src/cmd/go/signal.go:28: onceCloseInterrupted.Do(closeInterrupted)
    I'm sorry to harp on this. I don't think the sync.Once handler is adding
    anything that

    go func() {
    <- sig
    close(closeInterrupted)
    }()

    wouldn't do

    https://codereview.appspot.com/6903061/
  • Dave at Dec 14, 2012 at 12:17 am
    Sorry, I meant to write
    go func() {
    <- sig
    close(interrupted)
    }()

    https://codereview.appspot.com/6903061/
  • Alex Brainman at Dec 14, 2012 at 12:26 am
    Hello golang-dev@googlegroups.com, dave@cheney.net, rsc@golang.org (cc:
    golang-dev@googlegroups.com),

    Please take another look.


    https://codereview.appspot.com/6903061/
  • Dave at Dec 14, 2012 at 12:39 am
    LGTM. All my manual tests pass.

    Thank you for your persistence, this is going to be a really useful
    feature.

    https://codereview.appspot.com/6903061/
  • Alex Brainman at Dec 14, 2012 at 12:42 am

    On 2012/12/14 00:39:16, dfc wrote:
    LGTM. All my manual tests pass.

    Thank you for your help. I will submit it tonight - give others chance
    to comment.

    Alex

    https://codereview.appspot.com/6903061/
  • Alex Brainman at Dec 14, 2012 at 6:34 am
    *** Submitted as
    https://code.google.com/p/go/source/detail?r=ee5afd4b14b7 ***

    cmd/go: handle os signals

    Ignore signals during "go run" and wait for running child
    process to exit. Stop executing further tests during "go test",
    wait for running tests to exit and report error exit code.

    Original CL 6351053 by dfc.

    Fixes issue 3572.
    Fixes issue 3581.

    R=golang-dev, dave, rsc
    CC=golang-dev
    https://codereview.appspot.com/6903061


    https://codereview.appspot.com/6903061/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedDec 13, '12 at 11:45p
activeDec 14, '12 at 6:34a
posts11
users2
websitegolang.org

2 users in discussion

Alex Brainman: 6 posts Dave: 5 posts

People

Translate

site design / logo © 2022 Grokbase