unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: unicorn list <mongrel-unicorn@rubyforge.org>
Cc: Yoav Aner <yoav@kenhub.com>
Subject: Re: using unicorn with logging-rails gem
Date: Fri, 30 Nov 2012 20:05:35 +0000	[thread overview]
Message-ID: <20121130200535.GA743@dcvr.yhbt.net> (raw)
In-Reply-To: <CA+mA6PgTGcyLy2Dua9a6gDWhRwsQLtHEyk17fhBE8DW1TkO5EA@mail.gmail.com>

Yoav Aner <yoav@kenhub.com> wrote:
> Hi Eric,
> 
> Thanks a bunch for getting back so quickly on this.
> 
> I followed your suggestion and tried with `preload_app = false` and looks
> like this seems to fix this problem! Any idea what can go wrong when it's
> set to true or how I can try go about fixing this??

preload_app is false by default because it's the most likely to work
for all gems.

I suspect there's a shared resource (file/socket) or some cached value
that's initialized before fork and loses state after forking.

It's a fairly common issue with database libraries

> I haven't yet contacted the logging / logging-rails project. Perhaps that's
> a good idea. Considering the gem did/does work fine on my dev environment
> and with phusion passenger (and now it seems also with Unicorn, albeit with
> preload_app = false), I wasn't sure whether the problem is with this gem or
> elsewhere.
> 
> Any tips on how to investigate this further or resolve this, or what
> information I can give the gem maintainer(s) would be much appreciated.

I would definitely contact the maintainer of logging/logging-rails
on how to reinitialize any state after forking.
_______________________________________________
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

  parent reply	other threads:[~2012-11-30 20:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-30 17:20 using unicorn with logging-rails gem Yoav Aner
2012-11-30 19:15 ` Eric Wong
2012-11-30 19:59   ` Yoav Aner
     [not found]   ` <CA+mA6PgTGcyLy2Dua9a6gDWhRwsQLtHEyk17fhBE8DW1TkO5EA@mail.gmail.com>
2012-11-30 20:05     ` Eric Wong [this message]
2012-11-30 20:17       ` Yoav Aner
2012-11-30 20:55         ` 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=20121130200535.GA743@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=mongrel-unicorn@rubyforge.org \
    --cc=yoav@kenhub.com \
    /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).