{"number":3394,"pull_request":{"number":3394,"issue_url":"https://github.com/rails/rails/issues/3394","head":{"repo":{"master_branch":null,"name":"rails","created_at":"2011-06-24T15:01:55Z","size":128,"clone_url":"https://github.com/bdurand/rails.git","private":false,"updated_at":"2011-10-21T19:19:18Z","watchers":1,"ssh_url":"git@github.com:bdurand/rails.git","url":"https://api.github.com/repos/bdurand/rails","git_url":"git://github.com/bdurand/rails.git","language":"Ruby","fork":true,"svn_url":"https://svn.github.com/bdurand/rails","id":1948068,"pushed_at":"2011-10-21T19:19:17Z","open_issues":0,"homepage":"http://rubyonrails.org","description":"Ruby on Rails","forks":0,"html_url":"https://github.com/bdurand/rails","owner":{"avatar_url":"https://secure.gravatar.com/avatar/864712d425f9b850d18e6273a18cff8d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"864712d425f9b850d18e6273a18cff8d","url":"https://api.github.com/users/bdurand","id":41791,"login":"bdurand"}},"label":"bdurand:buffered_logger_threads","sha":"d565fda5f27abf0097adf7b3e232a52f7ae5c1e9","ref":"buffered_logger_threads","user":{"avatar_url":"https://secure.gravatar.com/avatar/864712d425f9b850d18e6273a18cff8d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"864712d425f9b850d18e6273a18cff8d","url":"https://api.github.com/users/bdurand","id":41791,"login":"bdurand"}},"merged_by":null,"created_at":"2011-10-21T19:25:08Z","changed_files":2,"merged":false,"body":"There are a couple of threading issues with ActiveSupport::BufferedLogger.\r\n\r\nIf a thread is spawned and logs messages but does not flush the log, the messages will never be written and will remain in the buffer forever.\r\n\r\n```ruby\r\nthreads = []\r\nurls.each do |url\r\nthreads << Thread.new do\r\n\r\nlogger.info(\"fetching #{url}\")\r\nfetch(url)\r\nlogger.info(\"#{url} retrieved\")\r\nend end\r\nthreads.each{|t| t.join}\r\n```\r\n\r\nSilencing a logger for a block in one thread will silence it will silence it for all other threads as well. This means in a multi-threaded Rails application, log messages can be lost.\r\n\r\n(Note: this pull request was originally opened in Lighthouse at https://rails.lighthouseapp.com/projects/8994/tickets/6671)","comments":0,"title":"Fix threading issues with BufferedLogger.","additions":89,"diff_url":"https://github.com/rails/rails/pull/3394.diff","updated_at":"2011-10-21T19:25:08Z","url":"https://api.github.com/repos/rails/rails/pulls/3394","id":423447,"patch_url":"https://github.com/rails/rails/pull/3394.patch","mergeable":null,"merged_at":null,"commits":1,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/864712d425f9b850d18e6273a18cff8d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"864712d425f9b850d18e6273a18cff8d","url":"https://api.github.com/users/bdurand","id":41791,"login":"bdurand"},"deletions":8,"html_url":"https://github.com/rails/rails/pull/3394","base":{"repo":{"master_branch":null,"name":"rails","created_at":"2008-04-11T02:19:47Z","size":38724,"clone_url":"https://github.com/rails/rails.git","private":false,"updated_at":"2011-10-21T19:25:08Z","watchers":10714,"ssh_url":"git@github.com:rails/rails.git","url":"https://api.github.com/repos/rails/rails","git_url":"git://github.com/rails/rails.git","language":"Ruby","fork":false,"svn_url":"https://svn.github.com/rails/rails","id":8514,"pushed_at":"2011-10-21T19:25:08Z","open_issues":532,"homepage":"http://rubyonrails.org","description":"Ruby on Rails","forks":2312,"html_url":"https://github.com/rails/rails","owner":{"avatar_url":"https://secure.gravatar.com/avatar/30f39a09e233e8369dddf6feb4be0308?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"30f39a09e233e8369dddf6feb4be0308","url":"https://api.github.com/users/rails","id":4223,"login":"rails"}},"label":"rails:master","sha":"e2aaae16292640f2314be205d7782f6eaf2b1cf5","ref":"master","user":{"avatar_url":"https://secure.gravatar.com/avatar/30f39a09e233e8369dddf6feb4be0308?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"30f39a09e233e8369dddf6feb4be0308","url":"https://api.github.com/users/rails","id":4223,"login":"rails"}},"state":"open"},"action":"opened"}