Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread andrey mirtchovski
thank you. i will definitely consider this in the future! On Tue, Sep 18, 2018 at 8:29 PM Dave Cheney wrote: > > profile.Start() installs a ^C handler to try to make sure profiles are > properly flushed to disk before your process goes to the bit bucket in the > sky. > > > On 19 Sep 2018, at 12:

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Dave Cheney
profile.Start() installs a ^C handler to try to make sure profiles are properly flushed to disk before your process goes to the bit bucket in the sky. > On 19 Sep 2018, at 12:23, andrey mirtchovski wrote: > > you're talking about https://github.com/pkg/profile, presumably. while > i did find t

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread andrey mirtchovski
you're talking about https://github.com/pkg/profile, presumably. while i did find that fairly quickly and it appears to be very useful, it wasn't immediately obvious that it would solve my particular issue. unfortunately we're also averse to importing third-party packages without additional vetting

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Dave Cheney
pkg /profile will do the paperwork for you so ^C works when profiling. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com.

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Eric Raymond
MR and CLA submitted. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread andrey mirtchovski
> It's a plausible mistake from any old Unix hand, I think. anecdotally, i ran into this very same issue yesterday when trying to instrument a 1.10 go program that allocated (but never used) more than 512 gigabytes of memory. i put in the memprofile saving code as a deferred closure in main and hi

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Eric Raymond
On Tuesday, September 18, 2018 at 6:14:54 PM UTC-4, Ian Lance Taylor wrote: > > > Under "Default behavior of signals in Go programs" in the Signals > package > > documentation, the one sentence "Defer hooks are *not* fired after > signal > > receipt." would head off potential confusion on this

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Ian Lance Taylor
On Tue, Sep 18, 2018 at 2:04 PM, Eric Raymond wrote: > On Tuesday, September 18, 2018 at 4:10:52 PM UTC-4, Ian Lance Taylor wrote: >> >> Signals in Go never interrupt functions. > > > Thank you, that was an admirably clear reply. > > I think this needs to be documented more prominently. Can I fil

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Eric Raymond
On Tuesday, September 18, 2018 at 4:10:52 PM UTC-4, Ian Lance Taylor wrote: > > Signals in Go never interrupt functions. > Thank you, that was an admirably clear reply. I think this needs to be documented more prominently. Can I file an MR against the Go documentation? Web search is not telli

Re: [go-nuts] Interaction of signals with defer

2018-09-18 Thread Ian Lance Taylor
On Tue, Sep 18, 2018 at 12:42 PM, Eric Raymond wrote: > > If interruption of a function with defers is interrupted by an uncaught > signal (say, ^C from the keyboard) do its defer hooks fire? What about defer > hooks in functions up the call stack? If the interrupt happens during a > defer hook's