rubyrep 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/lib/rubyrep/replication_runner.rb +3 -1
- data/lib/rubyrep/version.rb +1 -1
- data/spec/replication_runner_spec.rb +21 -11
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
data/History.txt
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 1.0.1 2009-03-25
|
2
|
+
|
3
|
+
* 3 minor enhancements:
|
4
|
+
* Verified compatibility with active_record 2.3.2 and jruby 1.2.0
|
5
|
+
* Released jruby bunde with the updated activerecord and jruby
|
6
|
+
* Catch ctrl+c and execute graceful shutdown
|
7
|
+
|
1
8
|
== 1.0.0 2009-03-07
|
2
9
|
|
3
10
|
* 1 major enhancement:
|
@@ -89,7 +89,9 @@ EOS
|
|
89
89
|
@termination_mutex = Mutex.new
|
90
90
|
@termination_mutex.lock
|
91
91
|
@waiter_thread ||= Thread.new {@termination_mutex.lock; self.termination_requested = true}
|
92
|
-
|
92
|
+
%w(TERM INT).each do |signal|
|
93
|
+
Signal.trap(signal) {puts "\nCaught '#{signal}': Initiating graceful shutdown"; @termination_mutex.unlock}
|
94
|
+
end
|
93
95
|
end
|
94
96
|
|
95
97
|
# Prepares the replication
|
data/lib/rubyrep/version.rb
CHANGED
@@ -90,20 +90,30 @@ describe ReplicationRunner do
|
|
90
90
|
|
91
91
|
runner.pause_replication
|
92
92
|
end
|
93
|
-
|
94
|
-
it "init_waiter should setup correct
|
95
|
-
|
96
|
-
|
93
|
+
|
94
|
+
it "init_waiter should setup correct signal processing" do
|
95
|
+
org_stdout = $stdout
|
96
|
+
$stdout = StringIO.new
|
97
|
+
begin
|
98
|
+
runner = ReplicationRunner.new
|
99
|
+
runner.stub!(:session).and_return(Session.new(standard_config))
|
97
100
|
|
98
|
-
|
99
|
-
|
101
|
+
# simulate sending the TERM signal
|
102
|
+
Signal.should_receive(:trap).with('TERM').and_yield
|
103
|
+
|
104
|
+
# also verify that the INT signal is trapped
|
105
|
+
Signal.should_receive(:trap).with('INT')
|
100
106
|
|
101
|
-
|
107
|
+
runner.init_waiter
|
102
108
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
109
|
+
# verify the that any pause would have been prematurely finished and
|
110
|
+
# termination signal been set
|
111
|
+
runner.termination_requested.should be_true
|
112
|
+
runner.instance_variable_get(:@waiter_thread).should_not be_alive
|
113
|
+
$stdout.string.should =~ /TERM.*shutdown/
|
114
|
+
ensure
|
115
|
+
$stdout = org_stdout
|
116
|
+
end
|
107
117
|
end
|
108
118
|
|
109
119
|
it "prepare_replication should call ReplicationInitializer#prepare_replication" do
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyrep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arndt Lehmann
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
NwT26VZnE2nr8g==
|
31
31
|
-----END CERTIFICATE-----
|
32
32
|
|
33
|
-
date: 2009-03-
|
33
|
+
date: 2009-03-25 00:00:00 +09:00
|
34
34
|
default_executable:
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
metadata.gz.sig
CHANGED
Binary file
|