zeus 0.13.0 → 0.13.1
Sign up to get free protection for your applications and to get access to all the features.
- data/build/zeus-darwin-amd64 +0 -0
- data/build/zeus-linux-386 +0 -0
- data/build/zeus-linux-amd64 +0 -0
- data/lib/zeus.rb +7 -11
- data/lib/zeus/rails.rb +9 -2
- data/lib/zeus/version.rb +1 -1
- metadata +2 -2
data/build/zeus-darwin-amd64
CHANGED
Binary file
|
data/build/zeus-linux-386
CHANGED
Binary file
|
data/build/zeus-linux-amd64
CHANGED
Binary file
|
data/lib/zeus.rb
CHANGED
@@ -39,6 +39,7 @@ module Zeus
|
|
39
39
|
|
40
40
|
setup_dummy_tty!
|
41
41
|
master = setup_master_socket!
|
42
|
+
feature_pipe_r, feature_pipe_w = IO.pipe
|
42
43
|
|
43
44
|
# I need to give the master a way to talk to me exclusively
|
44
45
|
local, remote = UNIXSocket.pair(Socket::SOCK_STREAM)
|
@@ -46,6 +47,7 @@ module Zeus
|
|
46
47
|
|
47
48
|
# Now I need to tell the master about my PID and ID
|
48
49
|
local.write "P:#{Process.pid}:#{identifier}\0"
|
50
|
+
local.send_io(feature_pipe_r)
|
49
51
|
|
50
52
|
# Now we run the action and report its success/fail status to the master.
|
51
53
|
features = Zeus::LoadTracking.features_loaded_by {
|
@@ -53,7 +55,7 @@ module Zeus
|
|
53
55
|
}
|
54
56
|
|
55
57
|
# the master wants to know about the files that running the action caused us to load.
|
56
|
-
Thread.new { notify_features(
|
58
|
+
Thread.new { notify_features(feature_pipe_w, features) }
|
57
59
|
|
58
60
|
# We are now 'connected'. From this point, we may receive requests to fork.
|
59
61
|
loop do
|
@@ -81,9 +83,8 @@ module Zeus
|
|
81
83
|
remote.close
|
82
84
|
sock.close
|
83
85
|
|
84
|
-
pid_and_arguments = local.recv(1024)
|
86
|
+
pid_and_arguments = local.recv(1024) # if starting client before boot slave is latched, we get stuck here. We also get stuck here in #182.
|
85
87
|
pid_and_arguments.chomp!("\0")
|
86
|
-
# pid_and_arguments.force_encoding("ASCII-8BIT")
|
87
88
|
pid_and_arguments =~ /(.*?):(.*)/
|
88
89
|
client_pid, arguments = $1.to_i, $2
|
89
90
|
arguments.chomp!("\0")
|
@@ -123,21 +124,16 @@ module Zeus
|
|
123
124
|
Process.kill(0, client_pid)
|
124
125
|
rescue Errno::ESRCH
|
125
126
|
Process.kill(9, command_pid)
|
127
|
+
exit 0
|
126
128
|
end
|
127
129
|
sleep 1
|
128
130
|
}
|
129
131
|
}
|
130
132
|
end
|
131
133
|
|
132
|
-
def notify_features(
|
134
|
+
def notify_features(pipe, features)
|
133
135
|
features.each do |t|
|
134
|
-
|
135
|
-
sock.write "F:#{t}\0"
|
136
|
-
sock.flush
|
137
|
-
rescue Errno::ENOBUFS
|
138
|
-
sleep 0.2
|
139
|
-
retry
|
140
|
-
end
|
136
|
+
pipe.puts t
|
141
137
|
end
|
142
138
|
end
|
143
139
|
|
data/lib/zeus/rails.rb
CHANGED
@@ -221,8 +221,15 @@ module Zeus
|
|
221
221
|
end
|
222
222
|
|
223
223
|
def reconnect_activerecord
|
224
|
-
ActiveRecord::Base
|
225
|
-
|
224
|
+
return unless defined?(ActiveRecord::Base)
|
225
|
+
begin
|
226
|
+
ActiveRecord::Base.clear_all_connections!
|
227
|
+
ActiveRecord::Base.establish_connection
|
228
|
+
if ActiveRecord::Base.respond_to?(:shared_connection)
|
229
|
+
ActiveRecord::Base.shared_connection = ActiveRecord::Base.retrieve_connection
|
230
|
+
end
|
231
|
+
rescue ActiveRecord::AdapterNotSpecified
|
232
|
+
end
|
226
233
|
end
|
227
234
|
|
228
235
|
def reconnect_redis
|
data/lib/zeus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zeus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|