Hi,
I'm having a loop fetching about 200 URL's. But after 170 gets, I get a SystemExit error.
The error is reproducible on Apache, but not on WEBrick in my
development environment. (OS X ![]()
This is the part that gets the page:
retrycount = 0 resp = nil begin timeout(10) do resp = Net::HTTP.get(URI.parse(url)) resp.to_s logger.debug("Sending to #{recipient}: #{resp}\n") end rescue TimeoutError if(retrycount < 2) retrycount+=1 retry else logger.info("ERROR url: " + url) logger.info("ERROR Timeout error in get_page, attempt #" + retrycount.to_s) nil end end resp.to_s rescue Exception => exception logger.info("ERROR Unknown error in get_page") logger.info(exception.class.to_s + " " + exception.message.to_s + " " + exception.backtrace.to_s) nil end
ERROR Unknown error in get_page SystemExit exit ../config/../vendor/rails/railties/lib/fcgi_handler.rb:126:in `exit'../config/../vendor/rails/railties/lib/fcgi_handler.rb:126:in `exit_now_handler'/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `to_proc'/usr/local/lib/ruby/1.8/net/http.rb:560:in `call'/usr/local/lib/ruby/1.8/net/http.rb:560:in `initialize'/usr/local/lib/ruby/1.8/net/http.rb:560:in `open'/usr/local/lib/ruby/1.8/net/http.rb:560:in `connect'/usr/local/lib/ruby/1.8/timeout.rb:48:in `timeout'/usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout'/usr/local/lib/ruby/1.8/net/http.rb:560:in `connect'/usr/local/lib/ruby/1.8/net/http.rb:553:in `do_start'/usr/local/lib/ruby/1.8/net/http.rb:542:in `start'/usr/local/lib/ruby/1.8/net/http.rb:379:in `get_response'/usr/local/lib/ruby/1.8/net/http.rb:356:in `get'../config/../app/controllers/sms_controller.rb:104:in `sms'/usr/local/lib/ruby/1.8/timeout.rb:56:in `timeout'/usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout'../config/../app/controllers/sms_controller.rb:103:in `sms'../config/../app/controllers/sms_controller.rb:53:in `send_sms'../config/../app/controllers/sms_controller.rb:52:in `each'../config/../app/controllers/sms_controller.rb:52:in `send_sms'../config/../vendor/rails/actionpack/lib/action_controller/base.rb:941:in `send'../config/../vendor/rails/actionpack/lib/action_controller/base.rb:941:in `perform_action_without_filters'../config/../vendor/rails/actionpack/lib/action_controller/filters.rb:368:in `perform_action_without_benchmark'../config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'../config/../vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in `perform_action_without_rescue'../config/../vendor/rails/actionpack/lib/action_controller/rescue.rb:82:in `perform_action'../config/../vendor/rails/actionpack/lib/action_controller/base.rb:408:in `send'../config/../vendor/rails/actionpack/lib/action_controller/base.rb:408:in `process_without_filters'../config/../vendor/rails/actionpack/lib/action_controller/filters.rb:377:in `process_without_session_management_support'../config/../vendor/rails/actionpack/lib/action_controller/session_management.rb:117:in `process'../config/../vendor/rails/railties/lib/dispatcher.rb:38:in `dispatch'../config/../vendor/rails/railties/lib/fcgi_handler.rb:150:in `process_request'../config/../vendor/rails/railties/lib/fcgi_handler.rb:54:in `process!'/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:612:in `each_cgi'/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each'/usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:609:in `each_cgi'../config/../vendor/rails/railties/lib/fcgi_handler.rb:53:in `process!'../config/../vendor/rails/railties/lib/fcgi_handler.rb:23:in `process!'dispatch.fcgi:28
Dont know it it matters, but line 28 in dispatch.fcgi looks like this: RailsFCGIHandler.process!
Any suggestions on how to avoid this problem?
Best regards, Martin Stabenfeldt