2012-03-15 3 views
3

私はいくつかの手がかりを必要とする非常に奇妙なバグを持っています。それがハングアップを取得しますサイレントルビ/レール障害は、すべてのメモリを消費し、サーバをクラッシュさせます

Started POST "/ipn_subscription_notifications" for 173.0.82.126 at 2012-03-15 04:11:45 -0400 
    Processing by IpnSubscriptionNotificationsController#create as HTML 
    Parameters: {"txn_type"=>"subscr_signup", etc... 

そして、ここで:

class ApplicationController < ActionController::Base 
    before_filter :set_timezone 

    def set_timezone 
    if logged_in? 
     Time.zone = current_user.time_zone 
    end 
    end 

PayPalが通知を送信しようとすると、それはそうのように入ってくる:これを考えてみましょう。 Rubyは、マシンがクラッシュするまでメモリを噛み始めます。

def set_timezone 
    if current_user 
    Time.zone = current_user.time_zone 
    end 
end 

だがlogged_in?を見てみましょう:修正と論理的に等価である

module AuthenticatedSystem 
    def logged_in? 
    current_user ? true : false 
    end 

これは修正です。

エラーがスローされて捕捉され、誰かがリクエストプロセスを再開していると思われます。 AuthenticatedSystemは確かに疑わしいです。これは、開発環境では発生しません

、それはエラーをスローし、500を返します。

Started POST "/ipn_subscription_notifications" for 127.0.0.1 at 2012-03-15 15:19:39 -0700 
    Processing by IpnSubscriptionNotificationsController#create as */* 
    Parameters: {"foobar"=>nil} 
Completed 500 Internal Server Error in 9ms 

NoMethodError (undefined method `logged_in?' for #<IpnSubscriptionNotificationsController:0xdfdaaf4>): 
    app/controllers/application_controller.rb:8:in `set_timezone' 

Rendered /usr/local/rvm/gems/[email protected]/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.3ms) 
Rendered /usr/local/rvm/gems/[email protected]/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms) 
Rendered /usr/local/rvm/gems/[email protected]/gems/actionpack-3.1.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (4.8ms) 
[2012-03-15 15:19:40] ERROR Errno::ECONNRESET: Connection reset by peer 
    /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `eof?' 
    /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `run' 
    /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread' 

、このような障害を検出し、優雅にそれらを扱う私の目標です。

アイデア?乗客、またはレールスタックの他の部分を計測することはできますか?

+0

rvm info、bundle show:http://sync.in/86yKG0Qg2f –

+0

あなたは 'restful-authentication'を使っていますか?もしそうなら、どのフォーク? – jdl

+0

私は静かな認証を使用していませんが、authlogic(2.1.6 03ed66a) –

答えて

0

エラーは未定義です。メソッドlogged_in?あなたのIpnSubscriptionNotificationsControllerであり、このコントローラApplicationControllerに継承し、uは必ずあなたのApplicationControllerにしてAuthenticatedSystemモジュールが含まれている、uはこの最初の

関連する問題