-
Notifications
You must be signed in to change notification settings - Fork 2
Ennoumuが無応答になる #15
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
Comments
どうも、ご迷惑をおかけしているようで、申し訳ありません。 |
いつも素早い対応ありがとうございます。 ただ、応答がなくなるのは Ctrl-Cを押したからではなく、いつの間にかリクエストが受け付けられなくなっています。 server.script = @script @logger.info "script=#{server.script}, #{@script}" @logger.info "Ennou(#{::Ennou::VERSION}) start for http://#{@host}:#{@port}#{@script} pid=#{$$}" loop do begin r = server.wait(60) next if r.nil? run_thread(app, *r) rescue Interrupt break rescue => e p e p e.backtrace.join("\n") end end @logger.info "Ennou(#{::Ennou::VERSION}) stop service for http://#{@host}:#{@port}#{@script} pid=#{$$}" |
情報ありがとうございます。おそらくrackの問題ではなくennouに何か考慮不足があるのだと思います。 |
回答ありがとうございます。 なるほど、@server.open から再試行するというのは試してみたいと思います。 他に怪しいログが出ているのには気づきませんでした。 |
EnnouでもEnnoumuでも起きるようですが、Ennoustでは起きませんでした。 |
どうもありがとうございます。ということは、ennou(Rubyの可能性もありますが)の、スレッド制御がうまくいっていなくて、HTTPキューをよからぬ状態にしてしまうバグがありそうです。とりあえずは、その方向で見直してみます。 |
その後、Ennoust(正確には以前非公式に頂いたシングルスレッド版Ennoumuです。Ennoustとの差異はキュー名のみ)でも発生を確認しました。 C:/***/lib/ruby/vendor_ruby/1.9.1/rack/handler/ennoumu.rb:86:in `close': unknown error - call HttpSendHttpResponse (1229)(SystemCallError) from C:/***/lib/ruby/vendor_ruby/1.9.1/rack/handler/ennoumu.rb:86:in `run_single_thread' from C:/***/lib/ruby/vendor_ruby/1.9.1/rack/handler/ennoumu.rb:57:in `block (2 levels) in run' from C:/***/lib/ruby/vendor_ruby/1.9.1/rack/handler/ennoumu.rb:53:in `loop' from C:/***/lib/ruby/vendor_ruby/1.9.1/rack/handler/ennoumu.rb:53:in `block in run' from C:/***/lib/ruby/vendor_ruby/1.9.1/rack/handler/ennoumu.rb:28:in `open' from C:/***/lib/ruby/vendor_ruby/1.9.1/rack/handler/ennoumu.rb:28:in `run' from C:/***/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:265:in `start' from C:/***/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:137:in `start' from C:/***/lib/ruby/gems/1.9.1/gems/rack-1.4.1/bin/rackup:4:in `<top (required)>' from C:/***/bin/rackup:23:in `load' from C:/***/bin/rackup:23:in `<main>' |
http://support.microsoft.com/kb/820729/ja#LetMeFixItMyselfAlways に従い、http.sys のログを採取しましたが、 あと、意図せず workerが死んだ時に、再度 workerを起動するアドホックなパッチを作成してみました。 お手数ですがよろしくお願いいたします。 ※ preタグ使っているのに、なぜか < が展開されてしまうので、一部 < と書いています。 diff -ur orig/ennoumu.rb ad_hoc/ennoumu.rb --- orig/ennoumu.rb 2013-06-03 21:28:22.000000000 +0900 +++ ad_hoc/ennoumu.rb 2013-07-03 18:58:22.000000000 +0900 @@ -42,14 +42,22 @@ @logger.info " spawn worker pid=#{pids.last}" end until @stoprun do - sleep 1 - end + chld = Process.wait + pids.reject! {|pid| pid == chld} + if $?.exitstatus == 2 + # spawn the new worker process(ad hoc) + pids << spawn(cmd) + @logger.info " spawn worker pid=#{pids.last}" + STDOUT.print "\n" + end + end @logger.info "Ennou(#{::Ennou::VERSION}) controller pid=#{$$} stop" Process.waitall else server.script = @script @logger.info "script=#{server.script}, #{@script}" @logger.info "Ennou(#{::Ennou::VERSION}) start for http://#{@host}:#{@port}#{@script} pid=#{$$}" + ret = 0 loop do begin r = server.wait(60) @@ -57,9 +65,13 @@ run_thread(app, *r) rescue Interrupt break + rescue => e + ret = 2 + break end end @logger.info "Ennou(#{::Ennou::VERSION}) stop service for http://#{@host}:#{@port}#{@script} pid=#{$$}" + exit ret end end end |
パッチありがとうございます。EnnnouMuとEnnouSt両方に取り込みました。 |
もう一点だけ、すいません。 |
すみません、完全に見落としていました。 |
色々調べていて、こちらのコードが不具合のトリガーになっていると思われるのを見つけました。 アプリログに assets のログを出さないようにするため、下記の config/initializers/quiet_assets.rb を追加していました。 Rails.application.assets.logger = Logger.new('nul') # これをコメントアウトすると発生しない。 Rails::Rack::Logger.class_eval do def call_with_quiet_assets(env) previous_level = Rails.logger.level Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0 call_without_quiet_assets(env).tap do Rails.logger.level = previous_level end end alias_method_chain :call, :quiet_assets end |
調査、どうもありがとうございます。 |
そうですか、こちらでは効果があった(と感じただけかもしれませんが、、、)のですが、確かに他にも色々沢山作っているので、それらの複合条件でおきるのかもしれません。 どうも色々とありがとうございました。 |
どうもお役に立てなくてすみません。 |
いつもNougakuDoにお世話になっております。またクローズ後時間がたっての書き込み失礼します。 私もこちらと同様の現象がでました。 上記で書かれているassets_quiet.rbに加え、 ご報告まで。 |
ご報告どうもありがとうございます。 |
いつもお世話になっております。
NougakuDo 1.3.5の環境で、RailsアプリをEnnoumuで実行していると、レスポンスが返ってこなくなることがあります(Win2008 R2、SQLServer2012Express使用)。
管理者コマンドプロンプトで、rackup -s Ennoumu -p 80 で実行しています。
まれに、コマンドプロンプトでEnterを叩くと動き出すことがあります。
2プロセスで使用していますが、やがて、新たなリクエストも受け付けられなくなり、Ctrl-Cを押しても
Ennou(1.1.6) stop service for http://+:80/da pid=xxx
を表示するものの終了しません(しばらく放置するとTerminate batch job (Y/N)?が表示されます)。
ennoumu.rb に rescue を(rescue Interruptの下に)追加し backtrace を取得してみたところ、以下を延々と出力しているようです。
なにが原因かわかりますでしょうか?
お手数ですがよろしくお願いいたします。
The text was updated successfully, but these errors were encountered: