mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
merge master
This commit is contained in:
commit
86e03e9c02
18 changed files with 111 additions and 15 deletions
16
Changes.md
16
Changes.md
|
@ -1,11 +1,23 @@
|
|||
# Sidekiq Changes
|
||||
|
||||
4.2.0
|
||||
HEAD
|
||||
-----------
|
||||
|
||||
- Enable development-mode code reloading. With Rails 5.0+, you don't need
|
||||
to restart Sidekiq to pick up your Sidekiq::Worker changes anymore! [#2457]
|
||||
|
||||
- Allow tuning of concurrency with the `RAILS_MAX_THREADS` env var. [#2985]
|
||||
This is the same var used by Puma so you can tune all of your systems
|
||||
the same way:
|
||||
```sh
|
||||
web: RAILS_MAX_THREADS=5 bundle exec puma ...
|
||||
worker: RAILS_MAX_THREADS=10 bundle exec sidekiq ...
|
||||
```
|
||||
Using `-c` or `config/sidekiq.yml` overrides this setting. I recommend
|
||||
adjusting your `config/database.yml` to use it too so connections are
|
||||
auto-scaled:
|
||||
```yaml
|
||||
pool: <%= ENV['RAILS_MAX_THREADS'] || 5 %>
|
||||
```
|
||||
|
||||
4.1.4
|
||||
-----------
|
||||
|
|
|
@ -3,7 +3,30 @@ Sidekiq Enterprise Changelog
|
|||
|
||||
Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
|
||||
|
||||
HEAD
|
||||
1.3.2
|
||||
-------------
|
||||
|
||||
- Upgrade encryption to use OpenSSL's more secure GCM mode. [#3060]
|
||||
|
||||
1.3.1
|
||||
-------------
|
||||
|
||||
- Fix multi-process memory monitoring on CentOS 6.x [#3063]
|
||||
- Polish the new encryption feature a bit.
|
||||
|
||||
1.3.0
|
||||
-------------
|
||||
|
||||
- **BETA** [New encryption feature](https://github.com/mperham/sidekiq/wiki/Ent-Encryption)
|
||||
which automatically encrypts the last argument of a Worker, aka the secret bag.
|
||||
|
||||
1.2.4
|
||||
-------------
|
||||
|
||||
- Fix issue causing some minutely jobs to execute every other minute.
|
||||
- Log a warning if slow periodic processing causes us to miss a clock tick.
|
||||
|
||||
1.2.3
|
||||
-------------
|
||||
|
||||
- Periodic jobs could stop executing until process restart if Redis goes down [#3047]
|
||||
|
|
|
@ -3,6 +3,12 @@ Sidekiq Pro Changelog
|
|||
|
||||
Please see [http://sidekiq.org/](http://sidekiq.org/) for more details and how to buy.
|
||||
|
||||
3.3.2
|
||||
---------
|
||||
|
||||
- Minimize batch memory usage after success [#3083]
|
||||
- Extract batch's 24 hr linger expiry to a LINGER constant so it can be tuned. [#3011]
|
||||
|
||||
3.3.1
|
||||
---------
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ module Sidekiq
|
|||
startup: [],
|
||||
quiet: [],
|
||||
shutdown: [],
|
||||
heartbeat: [],
|
||||
},
|
||||
dead_max_jobs: 10_000,
|
||||
dead_timeout_in_seconds: 180 * 24 * 60 * 60, # 6 months
|
||||
|
|
|
@ -208,6 +208,8 @@ module Sidekiq
|
|||
opts = parse_config(cfile).merge(opts) if cfile
|
||||
|
||||
opts[:strict] = true if opts[:strict].nil?
|
||||
opts[:concurrency] = Integer(ENV["RAILS_MAX_THREADS"]) if !opts[:concurrency] && ENV["RAILS_MAX_THREADS"]
|
||||
opts[:identity] = identity
|
||||
|
||||
options.merge!(opts)
|
||||
end
|
||||
|
|
|
@ -94,15 +94,19 @@ module Sidekiq
|
|||
end
|
||||
fails = procd = 0
|
||||
|
||||
_, _, _, msg = Sidekiq.redis do |conn|
|
||||
_, exists, _, _, msg = Sidekiq.redis do |conn|
|
||||
conn.multi do
|
||||
conn.sadd('processes', key)
|
||||
conn.exists(key)
|
||||
conn.hmset(key, 'info', json, 'busy', Processor::WORKER_STATE.size, 'beat', Time.now.to_f, 'quiet', @done)
|
||||
conn.expire(key, 60)
|
||||
conn.rpop("#{key}-signals")
|
||||
end
|
||||
end
|
||||
|
||||
# first heartbeat or recovering from an outage and need to reestablish our heartbeat
|
||||
fire_event(:heartbeat) if !exists
|
||||
|
||||
return unless msg
|
||||
|
||||
if JVM_RESERVED_SIGNALS.include?(msg)
|
||||
|
|
|
@ -4,6 +4,7 @@ require 'sidekiq/util'
|
|||
require 'sidekiq/processor'
|
||||
require 'sidekiq/fetch'
|
||||
require 'thread'
|
||||
require 'set'
|
||||
|
||||
module Sidekiq
|
||||
|
||||
|
|
|
@ -42,6 +42,18 @@ class TestCli < Sidekiq::Test
|
|||
assert_equal 60, Sidekiq.options[:concurrency]
|
||||
end
|
||||
|
||||
it 'changes concurrency with ENV' do
|
||||
begin
|
||||
ENV['RAILS_MAX_THREADS'] = '9'
|
||||
@cli.parse(['sidekiq', '-c', '60', '-r', './test/fake_env.rb'])
|
||||
assert_equal 60, Sidekiq.options[:concurrency]
|
||||
@cli.parse(['sidekiq', '-r', './test/fake_env.rb'])
|
||||
assert_equal 9, Sidekiq.options[:concurrency]
|
||||
ensure
|
||||
ENV.delete('RAILS_MAX_THREADS')
|
||||
end
|
||||
end
|
||||
|
||||
it 'changes queues' do
|
||||
@cli.parse(['sidekiq', '-q', 'foo', '-r', './test/fake_env.rb'])
|
||||
assert_equal ['foo'], Sidekiq.options[:queues]
|
||||
|
|
|
@ -15,8 +15,6 @@ class TestLauncher < Sidekiq::Test
|
|||
|
||||
describe 'heartbeat' do
|
||||
before do
|
||||
uow = Object.new
|
||||
|
||||
@mgr = new_manager(options)
|
||||
@launcher = Sidekiq::Launcher.new(options)
|
||||
@launcher.manager = @mgr
|
||||
|
@ -31,6 +29,18 @@ class TestLauncher < Sidekiq::Test
|
|||
$0 = @proctitle
|
||||
end
|
||||
|
||||
it 'fires new heartbeat events' do
|
||||
i = 0
|
||||
Sidekiq.on(:heartbeat) do
|
||||
i += 1
|
||||
end
|
||||
assert_equal 0, i
|
||||
@launcher.heartbeat('identity', heartbeat_data, Sidekiq.dump_json(heartbeat_data))
|
||||
assert_equal 1, i
|
||||
@launcher.heartbeat('identity', heartbeat_data, Sidekiq.dump_json(heartbeat_data))
|
||||
assert_equal 1, i
|
||||
end
|
||||
|
||||
describe 'when manager is active' do
|
||||
before do
|
||||
Sidekiq::CLI::PROCTITLES << proc { "xyz" }
|
||||
|
|
|
@ -752,3 +752,28 @@ div.interval-slider input {
|
|||
.redis-url {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.product-version {
|
||||
color:white;
|
||||
}
|
||||
|
||||
.warning-messages {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.toggle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.box {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.checkbox-column {
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.delete-confirm {
|
||||
width: 20%;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ de:
|
|||
NoScheduledFound: Keine geplanten Jobs gefunden
|
||||
When: Wann
|
||||
ScheduledJobs: Jobs in der Warteschlange
|
||||
idle: inaktiv
|
||||
idle: untätig
|
||||
active: aktiv
|
||||
Version: Version
|
||||
Connections: Verbindungen
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="container text-center">
|
||||
<ul class="nav">
|
||||
<li>
|
||||
<p class="navbar-text" style="color:white;"><%= product_version %></p>
|
||||
<p class="navbar-text product-version"><%= product_version %></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="navbar-text redis-url" title="<%= redis_connection_and_namespace %>"><%= redis_connection_and_namespace %></p>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<h3><%= t('Processes') %></h3>
|
||||
</div>
|
||||
<div class="col-sm-4 pull-right">
|
||||
<form method="POST" style="margin-top: 20px; margin-bottom: 10px;">
|
||||
<form method="POST" class="warning-messages">
|
||||
<%= csrf_tag %>
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn btn-warn" type="submit" name="quiet" value="1" data-confirm="<%= t('AreYouSure') %>"><%= t('QuietAll') %></button>
|
||||
|
@ -24,7 +24,7 @@
|
|||
</thead>
|
||||
<% processes.each do |process| %>
|
||||
<tr>
|
||||
<td width="50%">
|
||||
<td class="box">
|
||||
<%= "#{process['hostname']}:#{process['pid']}" %>
|
||||
<span class="label label-success"><%= process.tag %></span>
|
||||
<% process.labels.each do |label| %>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<table class="table table-striped table-bordered table-white">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20px" class="table-checkbox">
|
||||
<th class="table-checkbox checkbox-column">
|
||||
<label>
|
||||
<input type="checkbox" class="check_all" />
|
||||
</label>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<% if a.size > 100 %>
|
||||
<%= h(msg.display_args.inspect[0..100]) + "... " %>
|
||||
<button data-toggle="collapse" data-target="#worker_<%= index %>" class="btn btn-default btn-xs"><%= t('ShowAll') %></button>
|
||||
<div class="toggle" id="worker_<%= index %>" style="display: none;"><%= h(msg.display_args) %></div>
|
||||
<div class="toggle" id="worker_<%= index %>"><%= h(msg.display_args) %></div>
|
||||
<% else %>
|
||||
<%= h(msg.display_args) %>
|
||||
<% end %>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<% end %>
|
||||
</td>
|
||||
<td><%= number_with_delimiter(queue.size) %> </td>
|
||||
<td width="20%">
|
||||
<td class="delete-confirm">
|
||||
<form action="<%=root_path %>queues/<%= queue.name %>" method="post">
|
||||
<%= csrf_tag %>
|
||||
<input class="btn btn-danger btn-xs" type="submit" name="delete" value="<%= t('Delete') %>" data-confirm="<%= t('AreYouSureDeleteQueue', :queue => h(queue.name)) %>" />
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<table class="table table-striped table-bordered table-white">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20px" class="table-checkbox">
|
||||
<th class="table-checkbox checkbox-column">
|
||||
<label>
|
||||
<input type="checkbox" class="check_all" />
|
||||
</label>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<table class="table table-striped table-bordered table-white">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20px">
|
||||
<th class="checkbox-column">
|
||||
<input type="checkbox" class="check_all" />
|
||||
</th>
|
||||
<th><%= t('When') %></th>
|
||||
|
|
Loading…
Reference in a new issue