sidekiq 2.7.4 → 2.7.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq might be problematic. Click here for more details.

data/Changes.md CHANGED
@@ -1,3 +1,10 @@
1
+ 2.7.5
2
+ -----------
3
+
4
+ - Capistrano no longer uses daemonization in order to work with JRuby [#719]
5
+ - Refactor signal handling to work on Ruby 2.0 [#728, #730]
6
+ - Fix dashboard refresh URL [#732]
7
+
1
8
  2.7.4
2
9
  -----------
3
10
 
Binary file
@@ -36,7 +36,7 @@ Capistrano::Configuration.instance.load do
36
36
  task :start, :roles => lambda { fetch(:sidekiq_role) }, :on_no_matching_servers => :continue do
37
37
  rails_env = fetch(:rails_env, "production")
38
38
  for_each_process do |pid_file, idx|
39
- run "cd #{current_path} ; #{fetch(:sidekiq_cmd)} -d -e #{rails_env} -C #{current_path}/config/sidekiq.yml -i #{idx} -P #{pid_file} -L #{current_path}/log/sidekiq.log", :pty => false
39
+ run "cd #{current_path} ; nohup #{fetch(:sidekiq_cmd)} -e #{rails_env} -C #{current_path}/config/sidekiq.yml -i #{idx} -P #{pid_file} >> #{current_path}/log/sidekiq.log 2>&1 &", :pty => false
40
40
  end
41
41
  end
42
42
 
@@ -1,42 +1,11 @@
1
- trap 'INT' do
2
- if Sidekiq.options[:profile]
3
- result = RubyProf.stop
4
- printer = RubyProf::GraphHtmlPrinter.new(result)
5
- File.open("profile.html", 'w') do |f|
6
- printer.print(f, :min_percent => 1)
7
- end
8
- end
9
- # Handle Ctrl-C in JRuby like MRI
10
- # http://jira.codehaus.org/browse/JRUBY-4637
11
- Sidekiq::CLI.instance.interrupt
12
- end
13
-
14
- trap 'TERM' do
15
- # Heroku sends TERM and then waits 10 seconds for process to exit.
16
- Sidekiq::CLI.instance.interrupt
17
- end
18
-
19
- trap 'USR1' do
20
- Sidekiq.logger.info "Received USR1, no longer accepting new work"
21
- mgr = Sidekiq::CLI.instance.launcher.manager
22
- mgr.async.stop if mgr
23
- end
24
-
25
- trap 'USR2' do
26
- if Sidekiq.options[:logfile]
27
- Sidekiq.logger.info "Received USR2, reopening log file"
28
- Sidekiq::Logging.initialize_logger(Sidekiq.options[:logfile])
29
- end
30
- end
31
-
32
- trap 'TTIN' do
33
- Thread.list.each do |thread|
34
- Sidekiq.logger.info "Thread TID-#{thread.object_id.to_s(36)} #{thread['label']}"
35
- if thread.backtrace
36
- Sidekiq.logger.info thread.backtrace.join("\n")
37
- else
38
- Sidekiq.logger.info "<no backtrace available>"
39
- end
1
+ $sidekiq_signals = []
2
+
3
+ # Signal handlers should do as little as humanly possible
4
+ # and defer all work to a non-trap context. We'll have
5
+ # the main thread poll for signals and handle them there.
6
+ %w(INT TERM USR1 USR2 TTIN).each do |sig|
7
+ trap sig do
8
+ $sidekiq_signals << sig
40
9
  end
41
10
  end
42
11
 
@@ -99,7 +68,11 @@ module Sidekiq
99
68
  RubyProf.start
100
69
  end
101
70
  launcher.run
102
- sleep
71
+
72
+ while true
73
+ handle_signals
74
+ sleep 1
75
+ end
103
76
  rescue Interrupt
104
77
  logger.info 'Shutting down'
105
78
  launcher.stop
@@ -109,11 +82,41 @@ module Sidekiq
109
82
  end
110
83
  end
111
84
 
112
- def interrupt
113
- @interrupt_mutex.synchronize do
114
- unless @interrupted
115
- @interrupted = true
116
- Thread.main.raise Interrupt
85
+ def handle_signals
86
+ while sig = $sidekiq_signals.shift
87
+ Sidekiq.logger.debug "Got #{sig} signal"
88
+ case sig
89
+ when 'INT'
90
+ if Sidekiq.options[:profile]
91
+ result = RubyProf.stop
92
+ printer = RubyProf::GraphHtmlPrinter.new(result)
93
+ File.open("profile.html", 'w') do |f|
94
+ printer.print(f, :min_percent => 1)
95
+ end
96
+ end
97
+ # Handle Ctrl-C in JRuby like MRI
98
+ # http://jira.codehaus.org/browse/JRUBY-4637
99
+ raise Interrupt
100
+ when 'TERM'
101
+ # Heroku sends TERM and then waits 10 seconds for process to exit.
102
+ raise Interrupt
103
+ when 'USR1'
104
+ Sidekiq.logger.info "Received USR1, no longer accepting new work"
105
+ launcher.manager.async.stop
106
+ when 'USR2'
107
+ if Sidekiq.options[:logfile]
108
+ Sidekiq.logger.info "Received USR2, reopening log file"
109
+ Sidekiq::Logging.initialize_logger(Sidekiq.options[:logfile])
110
+ end
111
+ when 'TTIN'
112
+ Thread.list.each do |thread|
113
+ Sidekiq.logger.info "Thread TID-#{thread.object_id.to_s(36)} #{thread['label']}"
114
+ if thread.backtrace
115
+ Sidekiq.logger.info thread.backtrace.join("\n")
116
+ else
117
+ Sidekiq.logger.info "<no backtrace available>"
118
+ end
119
+ end
117
120
  end
118
121
  end
119
122
  end
@@ -1,3 +1,3 @@
1
1
  module Sidekiq
2
- VERSION = "2.7.4"
2
+ VERSION = "2.7.5"
3
3
  end
@@ -11,11 +11,11 @@ h5 Real-time
11
11
 
12
12
  h5
13
13
  span.history-heading History
14
- a href="#{{current_path}}?days=7" class="history-graph #{{"active" if params[:days] == "7"}}" 1 week
15
- a href="#{{current_path}}" class="history-graph #{{"active" if params[:days].nil? || params[:days] == "30"}}" 1 month
16
- a href="#{{current_path}}?days=90" class="history-graph #{{"active" if params[:days] == "90"}}" 3 month
17
- a href="#{{current_path}}?days=180" class="history-graph #{{"active" if params[:days] == "180"}}" 6 month
18
- #history data-processed="#{Sidekiq.dump_json(@processed_history)}" data-failed="#{Sidekiq.dump_json(@failed_history)}" data-update-url="#{{current_path}}dashboard/stats"
14
+ a href="#{{root_path}}?days=7" class="history-graph #{{"active" if params[:days] == "7"}}" 1 week
15
+ a href="#{{root_path}}" class="history-graph #{{"active" if params[:days].nil? || params[:days] == "30"}}" 1 month
16
+ a href="#{{root_path}}?days=90" class="history-graph #{{"active" if params[:days] == "90"}}" 3 month
17
+ a href="#{{root_path}}?days=180" class="history-graph #{{"active" if params[:days] == "180"}}" 6 month
18
+ #history data-processed="#{Sidekiq.dump_json(@processed_history)}" data-failed="#{Sidekiq.dump_json(@failed_history)}" data-update-url="#{{root_path}}dashboard/stats"
19
19
 
20
20
  br
21
21
  h5 Redis
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.4
4
+ version: 2.7.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain:
12
12
  - .public_cert.pem
13
- date: 2013-02-22 00:00:00.000000000 Z
13
+ date: 2013-02-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: redis