From: "Marc-André Cournoyer" Date: 2008-01-19T23:46:24+09:00 Subject: Re: [ANN] Thin 0.5.3 Purple Yogurt release Thin runs in a single thread, no need for a mutex there. On 19-Jan-08, at 1:42 AM, s.ross wrote: > Got it up and running ... for a while. It's running as root/root and > I'm not certain why it was not responding to proxied requests, but > I'll have to track that down later. Here's the puzzler for right now. > > I decided to use the sitealizer Rails plugin for this site and it > contains code such as: > > def store_visits > begin > mutex = Mutex.new > mutex.lock > $visits.each do |env| > SiteTracker.create( > :user_agent => env['HTTP_USER_AGENT'], > :language => env['HTTP_ACCEPT_LANGUAGE'], > :path => env['PATH_INFO'], > :ip => env['REMOTE_ADDR'], > :referer => env['HTTP_REFERER'] > ) > end > open(File.dirname(__FILE__)+'/last_update','w'){|f| f.puts > Time.now.to_s} > mutex.unlock > rescue => e > RAILS_ENV == 'production' ? logger.info(e) : logger.debug(e) > ensure > mutex.unlock > end > end > > This causes thin to crash as follows: > > ThreadError (not owner): > /vendor/plugins/sitealizer/lib/sitealizer.rb:80:in `unlock' > /vendor/plugins/sitealizer/lib/sitealizer.rb:51:in `join' > /vendor/plugins/sitealizer/lib/sitealizer.rb:51:in `use_sitealizer' > /vendor/rails/actionpack/lib/action_controller/filters.rb:456:in > `send' > /vendor/rails/actionpack/lib/action_controller/filters.rb:456:in > `call' > /vendor/rails/actionpack/lib/action_controller/filters.rb:435:in > `call' > /vendor/rails/actionpack/lib/action_controller/filters.rb:637:in > `call_filter' > /vendor/rails/actionpack/lib/action_controller/filters.rb:619:in > `perform_action_without_benchmark' > /vendor/rails/actionpack/lib/action_controller/benchmarking.rb: > 66:in `perform_action_without_rescue' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' > /vendor/rails/actionpack/lib/action_controller/benchmarking.rb: > 66:in `perform_action_without_rescue' > /vendor/rails/actionpack/lib/action_controller/rescue.rb:125:in > `perform_action' > /vendor/rails/actionpack/lib/action_controller/base.rb:473:in > `send' > /vendor/rails/actionpack/lib/action_controller/base.rb:473:in > `process_without_filters' > /vendor/rails/actionpack/lib/action_controller/filters.rb:624:in > `process_without_session_management_support' > /vendor/rails/actionpack/lib/action_controller/ > session_management.rb:114:in `sass_old_process' > /vendor/plugins/haml/lib/sass/plugin.rb:116:in `process' > /vendor/rails/actionpack/lib/action_controller/base.rb:326:in > `process' > /vendor/rails/railties/lib/dispatcher.rb:39:in `dispatch' > /usr/local/lib/ruby/gems/1.8/gems/thin-0.5.3/lib/rack/adapter/ > rails.rb:52:in `serve_rails' > /usr/local/lib/ruby/gems/1.8/gems/thin-0.5.3/lib/rack/adapter/ > rails.rb:67:in `call' > /usr/local/lib/ruby/gems/1.8/gems/thin-0.5.3/lib/thin/ > connection.rb:30:in `process' > /usr/local/lib/ruby/gems/1.8/gems/thin-0.5.3/lib/thin/ > connection.rb:16:in `receive_data' > /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/ > eventmachine.rb:1056:in `event_callback' > /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/ > eventmachine.rb:224:in `run_machine' > /usr/local/lib/ruby/gems/1.8/gems/eventmachine-0.10.0/lib/ > eventmachine.rb:224:in `run' > /usr/local/lib/ruby/gems/1.8/gems/thin-0.5.3/lib/thin/server.rb: > 55:in `listen!' > /usr/local/lib/ruby/gems/1.8/gems/thin-0.5.3/lib/thin/server.rb: > 44:in `start!' > /usr/local/lib/ruby/gems/1.8/gems/thin-0.5.3/bin/thin:85:in `start' > /usr/local/lib/ruby/gems/1.8/gems/thin-0.5.3/bin/thin:116:in `send' > /usr/local/lib/ruby/gems/1.8/gems/thin-0.5.3/bin/thin:116 > /usr/local/bin/thin:19:in `load' > /usr/local/bin/thin:19 > > Any thoughts? > > Thanks > > > On Jan 18, 2008, at 8:43 PM, Bob Hutchison wrote: > >> >> On 18-Jan-08, at 10:15 PM, s.ross wrote: >> >>> I can go to http://rootdomain: and there's my >>> site. However, I can't get to it using Apache's mod_proxy. >> >> >> Any luck with restarting or stop/start of apache? >> >> With OS X 10.5 I'm doing that a lot now, never in 10.4 -- if anyone >> knows what that's all about, do tell. >> >> Cheers, >> Bob >> >> ---- >> Bob Hutchison -- tumblelog at http://www.recursive.ca/so/ >> Recursive Design Inc. -- weblog at http://www.recursive.ca/hutch >> http://www.recursive.ca/ -- works on http://www.raconteur.info/cms-for-static-content/home/ >> >> >> > >