From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS14383 205.234.109.0/24 X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,FREEMAIL_FROM, MSGID_FROM_MTA_HEADER,RP_MATCHES_RCVD,T_DKIM_INVALID shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Jimmy Soho Newsgroups: gmane.comp.lang.ruby.unicorn.general Subject: Re: javascript disappears Date: Wed, 18 Aug 2010 13:39:44 +1000 Message-ID: References: <20100818011444.GA14052@dcvr.yhbt.net> <20100818024540.GA29950@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1282102800 10146 80.91.229.12 (18 Aug 2010 03:40:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 18 Aug 2010 03:40:00 +0000 (UTC) To: unicorn list Original-X-From: mongrel-unicorn-bounces@rubyforge.org Wed Aug 18 05:39:59 2010 Return-path: Envelope-to: gclrug-mongrel-unicorn@m.gmane.org X-Original-To: mongrel-unicorn@rubyforge.org Delivered-To: mongrel-unicorn@rubyforge.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=W1Fj68Wc2V+je4yJhVi5v3R0Dz4w/0gas8kqcEztSyE=; b=uGCnc4vFCdiGi9LabhUwS7vAHh46zLKtPIlFvjKFdPs6kgZ908dkY6KfMEuryCfo4Z klm/YOE34QVXPf6RlmDPVFIewdQsGqebx08iMVDab/dzlLXFHvPzOfMnSoAXjoihrKBm TQeDPm/7NQoLedWka63fRcUvfx2uVm3Yf1ScE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=I51qLedJEAAYEamWPjDXhOUQvcuDh+PtRibAnBlzjngUfOdn/W7XEAYGtP4L0FnjpV hQ5HVdZel7Flld2evuII1lQmXmZjbMMtsv2m8Xcnkt8zG5/EZPTx29EP/qbr9tWPhpD9 WwdPHbvyrUMx20jHdvmT19ANjTy2Nw2jFXhUw= In-Reply-To: <20100818024540.GA29950@dcvr.yhbt.net> X-BeenThere: mongrel-unicorn@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: mongrel-unicorn-bounces@rubyforge.org Errors-To: mongrel-unicorn-bounces@rubyforge.org Xref: news.gmane.org gmane.comp.lang.ruby.unicorn.general:680 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OlZVK-0002sa-Tg for gclrug-mongrel-unicorn@m.gmane.org; Wed, 18 Aug 2010 05:39:55 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 0F970185835E; Tue, 17 Aug 2010 23:39:54 -0400 (EDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by rubyforge.org (Postfix) with ESMTP id E8453185835A for ; Tue, 17 Aug 2010 23:39:44 -0400 (EDT) Received: by pzk28 with SMTP id 28so49113pzk.23 for ; Tue, 17 Aug 2010 20:39:44 -0700 (PDT) Received: by 10.142.156.14 with SMTP id d14mr6624303wfe.86.1282102784357; Tue, 17 Aug 2010 20:39:44 -0700 (PDT) Received: by 10.142.252.16 with HTTP; Tue, 17 Aug 2010 20:39:44 -0700 (PDT) > In your Capistrano deploy tasks, do you create/update the current > symlink before you send USR2? =A0You should have the symlink updated > before sending USR2.. Yes I do. Meanwhile I've been able to indeed reproduce the issue I was seeing if I prune releases. This is what I do: - ls /srv/app/releases shows only: /srv/app/releases/20100818022900 - stop unicorn - start unicorn - deploy new release (same code actually) - unicorn now has a different PID, /proc/31761/cwd does point to the latest release directory: /proc/31761/cwd -> /srv/app/releases/20100818024514 - refresh browser, ok, no issue. - rm -Rf /srv/app/releases/20100818022900 - deploy another new release - refresh browser: javascripts/base.js is missing nothing in unicorn.stderr.log, but looking in unicorn.stdout.log it mention= s: /srv/app/releases/20100818022900/Gemfile not found The unicorn process PID hasn't changed, nor has proc/31761/cwd My /srv/app/current dir now points to the latest release. Which I guess is wrong as well, as unicorn failed to start with the latest release; so it (=3D capistrano) needs to rollback somehow (which is a different issue). If I now peek in /proc/31761/environ then I notice these: GEM_HOME=3D/srv/app/releases/20100818022900/vendor/bundler_gems PATH=3D/srv/app/releases/20100818022900/vendor/bundler_gems/bin:[... etc.] GEM_PATH=3D/srv/app/releases/20100818022900/vendor/bundler_gems BUNDLE_GEMFILE=3D/srv/app/releases/20100818022900/Gemfile which are all pointing to the working directory I pruned. Hence the message about Gemfile not found I guess. Any suggestions how / when to update those environment variables with correct values? > Other folks here may have more experience with Capistrano+Unicorn, > maybe they have portable recipes they can share. Maybe it's more a gem and/or bundler thing? Though it seems like a general issue to me that environment variables can have references to old working directories, which need to be updated if you restart Unicorn with USR2 all the time. Is this something Unicorn could possibly take care off? Jimmy _______________________________________________ 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