FAQ
Not sure what's going on, hoping I'm being stupid.

Upgraded to 1.6 on Friday (hopefully not related), and one of our web
services started to hang. Able to open a tcp connection to it, but no
response (not sure how far the request is getting).

SIGQUIT revealed something, I think, interesting. Code like:


func flush() {
     for {
         select {
         case <-time.After(time.Minute):
              ...
         case <-s.shutdown:
             return
         }
     }
}()

is showing up as "goroutine 25 [select, 174 minutes]:"

I wouldn't expect that select to wait for 174 minutes. There were a couple
other similar cases also asleep for 174 minutes.

A goroutine which waits for a signal to reload was waiting for 216 minutes.
This is expected, but it seems to show that above code for for a while
before blocking).

Has anyone seen this? Any thoughts on where I might look next?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Shawn Milochik at Feb 22, 2016 at 6:21 pm
    What happens if the time.After hits? Does it return? Maybe it's being hit,
    then looping again and sticking forever.

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Karl at Feb 23, 2016 at 12:09 am
    Opps, sorry, bad thing to miss out.

    It just calls a function:

    func flush() {
         for {
             select {
             case <-time.After(time.Minute):
                  saveToDisk()
             case <-s.shutdown:
                 return
             }
         }
    }()

    On Tuesday, February 23, 2016 at 2:21:46 AM UTC+8, Shawn Milochik wrote:

    What happens if the time.After hits? Does it return? Maybe it's being hit,
    then looping again and sticking forever.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Val at Feb 22, 2016 at 10:21 pm
    If your timeout instructions contain a break statement, then keep in mind you're breaking out of the surrounding select, not the surrounding for.

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Karl at Feb 23, 2016 at 12:10 am
    It just calls a function, no return/break:

             case <-time.After(duration):
                 saveToDisk()
             case <-s.shutdownChan:
    On Tuesday, February 23, 2016 at 6:21:19 AM UTC+8, Val wrote:

    If your timeout instructions contain a break statement, then keep in mind
    you're breaking out of the surrounding select, not the surrounding for.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Mikespook at Feb 23, 2016 at 12:35 am
    According to your description it can be located at
    https://golang.org/src/runtime/traceback.go#L673. do you have any syscall
    in that `saveToDisk` function can cause such stun?
    On 23 February 2016 at 13:10, wrote:

    It just calls a function, no return/break:

    case <-time.After(duration):
    saveToDisk()
    case <-s.shutdownChan:

    On Tuesday, February 23, 2016 at 6:21:19 AM UTC+8, Val wrote:

    If your timeout instructions contain a break statement, then keep in mind
    you're breaking out of the surrounding select, not the surrounding for.
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.


    --
    Xing Xing (邢星)
    mikespook <mikespook@gmail.com>
    http://mikespook.com

    <http://tr.grammarly.com/aff_c?offer_id=97&aff_id=7225&file_id=1242>

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Karl at Feb 23, 2016 at 2:33 am
    Found the issue. Endless loop somewhere else. Should have noticed the
    spiked CPU load sooner. I'm guessing the dumps that say "goroutine running
    on other thread" without a stack is the reason I didn't see that this code
    was being executed.

    Cheers,
    Karl
    On Tuesday, February 23, 2016 at 8:35:16 AM UTC+8, mikespook wrote:

    According to your description it can be located at
    https://golang.org/src/runtime/traceback.go#L673. do you have any syscall
    in that `saveToDisk` function can cause such stun?

    On 23 February 2016 at 13:10, <ka...@secondspectrum.com <javascript:>>
    wrote:
    It just calls a function, no return/break:

    case <-time.After(duration):
    saveToDisk()
    case <-s.shutdownChan:

    On Tuesday, February 23, 2016 at 6:21:19 AM UTC+8, Val wrote:

    If your timeout instructions contain a break statement, then keep in
    mind you're breaking out of the surrounding select, not the surrounding for.
    --
    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...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/d/optout.


    --
    Xing Xing (邢星)
    mikespook <mike...@gmail.com <javascript:>>
    http://mikespook.com

    <http://tr.grammarly.com/aff_c?offer_id=97&aff_id=7225&file_id=1242>
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 22, '16 at 5:40p
activeFeb 23, '16 at 2:33a
posts7
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase