FAQ
I've been writing a program that listens on three different ports to handle
different protocols (http and two custom). I've been testing it for
awhile, and so far it's been working w/o problems. However, I just ran
into a situation where I stopped and restarted my program within the space
of a minute or so and it popped back with this error:

runtime: epollwait on fd -38 failed with 9

It's no clear to me what this signifies, and I was hoping someone here
could tell me -- I'm wondering if it implies I might be setting my servers
incorrectly. It appears to be coming from line 75 of
http://golang.org/src/pkg/runtime/netpoll_epoll.c, and I'm guessing 9
indicates an errno?

     70 retry: 71 n = runtime·epollwait(epfd, events, nelem(events), waitms); 72 if(n < 0) { 73 if(n != -EINTR && n != lasterr) { 74 lasterr = n; 75 runtime·printf("runtime: epollwait on fd %d failed with %d\n", epfd, -n); 76 } 77 goto retry; 78 }

--
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/groups/opt_out.

Search Discussions

  • Dave Cheney at Jul 6, 2013 at 4:09 am
    9 is EBADF, which makes sense, -38 is not a valid file descriptor.
    On Sat, Jul 6, 2013 at 2:01 PM, Jim Robinson wrote:
    I've been writing a program that listens on three different ports to handle
    different protocols (http and two custom). I've been testing it for awhile,
    and so far it's been working w/o problems. However, I just ran into a
    situation where I stopped and restarted my program within the space of a
    minute or so and it popped back with this error:

    runtime: epollwait on fd -38 failed with 9

    It's no clear to me what this signifies, and I was hoping someone here could
    tell me -- I'm wondering if it implies I might be setting my servers
    incorrectly. It appears to be coming from line 75 of
    http://golang.org/src/pkg/runtime/netpoll_epoll.c, and I'm guessing 9
    indicates an errno?

    70 retry:
    71 n = runtime·epollwait(epfd, events, nelem(events), waitms);
    72 if(n < 0) {
    73 if(n != -EINTR && n != lasterr) {
    74 lasterr = n;
    75 runtime·printf("runtime: epollwait on fd %d failed with %d\n",
    epfd, -n);
    76 }
    77 goto retry;
    78 }

    --
    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/groups/opt_out.
    --
    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/groups/opt_out.
  • James A. Robinson at Jul 6, 2013 at 4:39 am

    On Sat, Jul 6, 2013 at 2:01 PM, Jim Robinson wrote:
    runtime: epollwait on fd -38 failed with 9
    On Fri, Jul 5, 2013 at 9:09 PM, Dave Cheney wrote:
    9 is EBADF, which makes sense, -38 is not a valid file descriptor.
    Hrm, do you know if the the epoll have from a on a Listen? Besides
    the stock net/http server my in-house protocol server is listening on
    a socket and passing accepted connections off to a handler (nothing
    was making requests to the port at the time the error surfaced).

    // ListenAndServe binds to p.addr and serves requests.
    func (p *Proxy) ListenAndServe() (err error) {
      p.ln, err = net.Listen("tcp", p.listenAddr)
      if err != nil {
       return err
      }

      var tempDelay time.Duration
      for {
       conn, err := p.ln.Accept()
       if err != nil {
        if ne, ok := err.(net.Error); ok && ne.Temporary() {
         if tempDelay == 0 {
          tempDelay = 5 * time.Millisecond
         } else {
          tempDelay *= 2
         }
         if max := 1 * time.Second; tempDelay > max {
          tempDelay = max
         }
         if m, ok := trace.M(traceId, trace.Warn); ok {
          trace.T(m, "%v: retrying in %s", err, tempDelay)
         }
         time.Sleep(tempDelay)
         continue
        }
        return err
       }
       tempDelay = 0
       go p.Handle(newConn(conn, p.dur, p.wg))
      }
    }

    --
    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/groups/opt_out.
  • Albert Strasheim at Jul 6, 2013 at 8:15 pm
    Hello
    On Saturday, July 6, 2013 6:38:51 AM UTC+2, Jim Robinson wrote:
    On Sat, Jul 6, 2013 at 2:01 PM, Jim Robinson wrote:
    runtime: epollwait on fd -38 failed with 9
    On Fri, Jul 5, 2013 at 9:09 PM, Dave Cheney wrote:
    9 is EBADF, which makes sense, -38 is not a valid file descriptor.
    What version of Go is this? tip or 1.1.1?

    Can you reproduce this reliably? It might be useful to look at an strace of
    this program when this happens (if you're on Linux).

    Cheers

    Albert

    --
    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/groups/opt_out.
  • Jim Robinson at Jul 6, 2013 at 10:18 pm

    On Saturday, July 6, 2013 1:15:07 PM UTC-7, Albert Strasheim wrote:

    What version of Go is this? tip or 1.1.1?

    Can you reproduce this reliably? It might be useful to look at an strace
    of this program when this happens (if you're on Linux).
    I haven't been able to reproduce it. I think I'll put in some code to catch
    the particular error and print out a stack.

    This was on
       go version devel +b43eb215afd3 Fri Jun 28 18:37:06 2013 +0400 darwin/amd64

    Jim

    --
    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/groups/opt_out.
  • Michael Sunyan at Aug 12, 2014 at 4:24 am
    hi jim,
       I wonder that have you solved this "epollwait" issue? Because I recieved
    the same error recently.

    thanks.
    Mic

    在 2013年7月7日星期日UTC+8上午6时18分48秒,Jim Robinson写道:
    On Saturday, July 6, 2013 1:15:07 PM UTC-7, Albert Strasheim wrote:

    What version of Go is this? tip or 1.1.1?

    Can you reproduce this reliably? It might be useful to look at an strace
    of this program when this happens (if you're on Linux).
    I haven't been able to reproduce it. I think I'll put in some code to
    catch the particular error and print out a stack.

    This was on
    go version devel +b43eb215afd3 Fri Jun 28 18:37:06 2013 +0400
    darwin/amd64

    Jim
    --
    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.
  • Dave Cheney at Aug 14, 2014 at 6:40 am
    Which version of Go are you using. AFAIK the underlying issue was solved a
    year ago.
    On Tuesday, 12 August 2014 13:33:11 UTC+10, michael...@gmail.com wrote:

    hi jim,
    I wonder that have you solved this "epollwait" issue? Because I recieved
    the same error recently.

    thanks.
    Mic

    在 2013年7月7日星期日UTC+8上午6时18分48秒,Jim Robinson写道:
    On Saturday, July 6, 2013 1:15:07 PM UTC-7, Albert Strasheim wrote:

    What version of Go is this? tip or 1.1.1?

    Can you reproduce this reliably? It might be useful to look at an strace
    of this program when this happens (if you're on Linux).
    I haven't been able to reproduce it. I think I'll put in some code to
    catch the particular error and print out a stack.

    This was on
    go version devel +b43eb215afd3 Fri Jun 28 18:37:06 2013 +0400
    darwin/amd64

    Jim
    --
    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.
  • Michael Sunyan at Aug 14, 2014 at 10:00 am
    It is "go version go1.3 linux/amd64" which is the most updated for
    now(2014-08-14).


    在 2014年8月14日星期四UTC+8下午2时40分50秒,Dave Cheney写道:
    Which version of Go are you using. AFAIK the underlying issue was solved a
    year ago.
    On Tuesday, 12 August 2014 13:33:11 UTC+10, michael...@gmail.com wrote:

    hi jim,
    I wonder that have you solved this "epollwait" issue? Because I
    recieved the same error recently.

    thanks.
    Mic

    在 2013年7月7日星期日UTC+8上午6时18分48秒,Jim Robinson写道:
    On Saturday, July 6, 2013 1:15:07 PM UTC-7, Albert Strasheim wrote:

    What version of Go is this? tip or 1.1.1?

    Can you reproduce this reliably? It might be useful to look at an
    strace of this program when this happens (if you're on Linux).
    I haven't been able to reproduce it. I think I'll put in some code to
    catch the particular error and print out a stack.

    This was on
    go version devel +b43eb215afd3 Fri Jun 28 18:37:06 2013 +0400
    darwin/amd64

    Jim
    --
    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.
  • Dave Cheney at Aug 14, 2014 at 10:21 am
    Thanks for confirming. Please file a new bug, golang.org/issue including
    some kind of code to reproduce the problem.

    On Thursday, 14 August 2014 20:00:10 UTC+10, michael...@gmail.com wrote:

    It is "go version go1.3 linux/amd64" which is the most updated for
    now(2014-08-14).


    在 2014年8月14日星期四UTC+8下午2时40分50秒,Dave Cheney写道:
    Which version of Go are you using. AFAIK the underlying issue was solved
    a year ago.
    On Tuesday, 12 August 2014 13:33:11 UTC+10, michael...@gmail.com wrote:

    hi jim,
    I wonder that have you solved this "epollwait" issue? Because I
    recieved the same error recently.

    thanks.
    Mic

    在 2013年7月7日星期日UTC+8上午6时18分48秒,Jim Robinson写道:
    On Saturday, July 6, 2013 1:15:07 PM UTC-7, Albert Strasheim wrote:

    What version of Go is this? tip or 1.1.1?

    Can you reproduce this reliably? It might be useful to look at an
    strace of this program when this happens (if you're on Linux).
    I haven't been able to reproduce it. I think I'll put in some code to
    catch the particular error and print out a stack.

    This was on
    go version devel +b43eb215afd3 Fri Jun 28 18:37:06 2013 +0400
    darwin/amd64

    Jim
    --
    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
postedJul 6, '13 at 4:01a
activeAug 14, '14 at 10:21a
posts9
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase