Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange "dup: bad file descriptor" error with Einhorn #29

Closed
ghost opened this issue Jun 10, 2014 · 5 comments
Closed

Strange "dup: bad file descriptor" error with Einhorn #29

ghost opened this issue Jun 10, 2014 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 10, 2014

I try to use Goji with Einhorn and it shows this:

2014/06/11 02:42:50 graceful: Einhorn detected, adding SIGUSR2 handler
2014/06/11 02:42:50 dup: bad file descriptor
[MASTER 11532] INFO: ===> Exited worker 11778 before it was ACKed

dup: bad file descriptor error appears.

Sometimes Einhorn starts normally (and I don't know why exactly - I tried to remove some libraries and it works but then after some time this error appears again):

[MASTER 14292] INFO: [client 2:11] client connected
2014/06/11 02:50:12 bind: ACKing to einhorn

But when I use "upgrade" from einhornsh it shows:

2014/06/11 02:51:00 graceful: Einhorn detected, adding SIGUSR2 handler
2014/06/11 02:51:00 dup: bad file descriptor
[MASTER 14292] INFO: ===> Exited worker 14399 before it was ACKed
[MASTER 14292] INFO: Last spinup was 3.754994809s ago, and spinup_interval is 2.25s, so spinning up a new process (there have been 2 consecutive unacked worker deaths)

Command: go build && einhorn -b 127.0.0.1:8000 -m manual -n 2 ./app
System: Ubuntu 13.10
Non-standard packages:
"launchpad.net/goamz/aws"
"launchpad.net/goamz/s3"
"github.com/twinj/uuid"

@zenazn
Copy link
Owner

zenazn commented Jun 10, 2014

Hrm. Are you able to reproduce this behavior on the Goji example app? I wasn't able to reproduce on either OS X or Trusty, both running Go 1.2

@ghost
Copy link
Author

ghost commented Jun 11, 2014

I created repositories to reproduce this behaviour:
https://github.com/reterius/goji-bad-file-descriptor
https://github.com/reterius/goji-bad-file-descriptor-wuturl62

First repository - I use github.com/8protons/wut/wutlog from package https://github.com/8protons/wut
It's simple JSON logger, has dependency - github.com/8protons/wut/wuturl62

But in the second repository this strange error appears when I use github.com/8protons/wut/wuturl62 from package https://github.com/8protons/wut directly.
wuturl62 is my UUID -> base62 string converter, it depends on github.com/twinj/uuid

I tried to use github.com/twinj/uuid separately and it seems to be okay, no bad file descriptors.

Truth to be told, I don't know why it happens

@zenazn
Copy link
Owner

zenazn commented Jun 12, 2014

Oh boy—this was a fun one. I'll push a patch for this soon, with details in the commit message :)

@ghost
Copy link
Author

ghost commented Jun 12, 2014

I've migrated my code from Martini to Goji because of its canonical way to do things like middlewares (like onion) without any magic. And this appears in the process of deploying.

So, thank you very much for Goji. It's really cool.

@badoet
Copy link

badoet commented Jun 13, 2014

after updating to the latest goji i still have the same error.
with this main.go:

package main
import (
    "fmt"
    "net/http"
    "github.com/zenazn/goji"
)

func main() {
    goji.Get("/", HomeHandler)
    goji.Serve()
}

func HomeHandler(res http.ResponseWriter, req *http.Request) {
    fmt.Fprint(res, "this is home")
}

is it because im using go1.3beta2??

UPDATE
sorry my bad, everything works fine now. was not building my go project properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants