unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: "Jérémy Lecour" <jeremy.lecour@gmail.com>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Subject: Re: Address already in use
Date: Mon, 25 Jun 2012 15:41:04 +0200	[thread overview]
Message-ID: <6850AC53-0AB0-4914-BA38-556E08764C1A@gmail.com> (raw)
In-Reply-To: <0B72D3D4-CB04-47F2-B188-CAFDF41B8B1F@gmail.com>


Le 25 juin 2012 à 15:02, Manuel Palenciano Guerrero a écrit :

> Hello there,
> 
> I seem to have a problem with unix-sockets, and cannot see many people with the same situation when googling.
> 
> The problem is when upgrading (USR2 + QUIT) our applications. I get the following error very frequently but not always.
> 
> E, [2012-06-21T11:40:46.386486 #29401] ERROR -- : adding listener failed addr=/tmp/unicorn.app.sock (in use)
> E, [2012-06-21T11:40:46.386669 #29401] ERROR -- : retrying in 0.5 seconds (4 tries left)
> E, [2012-06-21T11:40:46.887724 #29401] ERROR -- : adding listener failed addr=/tmp/unicorn.app.sock (in use)
> E, [2012-06-21T11:40:46.887832 #29401] ERROR -- : retrying in 0.5 seconds (3 tries left)
> E, [2012-06-21T11:40:47.388813 #29401] ERROR -- : adding listener failed addr=/tmp/unicorn.app.sock (in use)
> E, [2012-06-21T11:40:47.388894 #29401] ERROR -- : retrying in 0.5 seconds (2 tries left)
> E, [2012-06-21T11:40:47.889878 #29401] ERROR -- : adding listener failed addr=/tmp/unicorn.app.sock (in use)
> E, [2012-06-21T11:40:47.889957 #29401] ERROR -- : retrying in 0.5 seconds (1 tries left)
> E, [2012-06-21T11:40:48.390939 #29401] ERROR -- : adding listener failed addr=/tmp/unicorn.app.sock (in use)
> E, [2012-06-21T11:40:48.391020 #29401] ERROR -- : retrying in 0.5 seconds (0 tries left)
> E, [2012-06-21T11:40:48.892002 #29401] ERROR -- : adding listener failed addr=/tmp/unicorn.app.sock (in use)
> /var/www/app/staging/shared/bundle/ruby/1.8/gems/unicorn-4.3.0/lib/unicorn/socket_helper.rb:140:in `initialize': Address already in use - /tmp/unicorn.app.sock (Errno::EADDRINUSE)
> 
> ...and the only way around that I know is stoping and starting the app, even in production.
> 
> We have preload_app => true, and ONLY listening on unix-sockets, no TCP-sockets.
> 
> The only solution I can think of would we switching to TCP, but would there be a reason on doing such ?
> 
> Is this happening to any body else ? and would you know a possible solution ?


Hi,

I've had the same issue, in the exact same context, and I've found found a fix.

As I was starting to play with Unicorn, I copied/pasted an init script and an Unicorn config script separately.

They were both trying to do a rolling upgrade and obviously one of them failed.

I've remove the rolling upgrade from the init script and do it only in the "before_fork" part of my Unicorn script.

You can find my configuration and init scripts in this Gist : https://gist.github.com/2988648


I hope this helps you.


Jérémy Lecour
Conception et développement d'applications web
06 22 43 88 94 - http://jeremy.wordpress.com - http://twitter.com/jlecour

_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

  reply	other threads:[~2012-06-25 14:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 13:02 Address already in use Manuel Palenciano Guerrero
2012-06-25 13:41 ` Jérémy Lecour [this message]
2012-06-25 13:42 ` Aaron Suggs
2012-06-25 18:10   ` Eric Wong
2012-06-25 21:10   ` Eric Wong
2012-06-25 20:28 ` Eric Wong
2012-06-25 21:03   ` Manuel Palenciano Guerrero
2012-06-25 23:57     ` Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://yhbt.net/unicorn/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6850AC53-0AB0-4914-BA38-556E08764C1A@gmail.com \
    --to=jeremy.lecour@gmail.com \
    --cc=mongrel-unicorn@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).