From efa3915b0cc1e54f981fd056d81d2885b8cbeca2 Mon Sep 17 00:00:00 2001 From: Mike Perham Date: Wed, 16 Oct 2013 20:32:15 -0700 Subject: [PATCH] Use resolv-replace so slow DNS lookups don't slow or halt Sidekiq --- Changes.md | 8 ++++++++ lib/sidekiq/cli.rb | 1 + lib/sidekiq/version.rb | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index b27ab8d9..4b786dd5 100644 --- a/Changes.md +++ b/Changes.md @@ -1,3 +1,11 @@ +2.16.0 +----------- + +- Use Ruby's `resolv-replace` to enable pure Ruby DNS lookups. + This ensures that any DNS resolution that takes place in worker + threads won't lock up the entire VM on MRI. + See this [blog post](http://coderrr.wordpress.com/2007/12/06/backgrounding-tasks-in-rails-with-threads-and-using-resolv-replace-to-make-them-faster/) for more info. + 2.15.2 ----------- diff --git a/lib/sidekiq/cli.rb b/lib/sidekiq/cli.rb index f4b14341..7b56c438 100644 --- a/lib/sidekiq/cli.rb +++ b/lib/sidekiq/cli.rb @@ -1,5 +1,6 @@ $stdout.sync = true +require 'resolv-replace' require 'yaml' require 'singleton' require 'optparse' diff --git a/lib/sidekiq/version.rb b/lib/sidekiq/version.rb index d67e8654..969dfa81 100644 --- a/lib/sidekiq/version.rb +++ b/lib/sidekiq/version.rb @@ -1,3 +1,3 @@ module Sidekiq - VERSION = "2.15.2" + VERSION = "2.16.0" end