rflow 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/.travis.yml +2 -0
- data/bin/rflow +34 -15
- data/lib/rflow/child_process.rb +2 -2
- data/lib/rflow/daemon_process.rb +2 -2
- data/lib/rflow/logger.rb +3 -1
- data/lib/rflow/message.rb +5 -1
- data/lib/rflow/pid_file.rb +4 -0
- data/lib/rflow/version.rb +1 -1
- data/rflow.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5206f9445f15732c6d46b1c08ab99abf54fbae0bc30b151418b3b950624d041a
|
4
|
+
data.tar.gz: 4db080a15115b86926acd0ebf78b74532fd4c22f79454eda00372236701550f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0de374d5901f28cb15b320b455a8c09a4f191f71b8f8d8695d56ba74987dbc9ef86d5207bacda72d062ca7848c3860853eee8373d471c8aa769aed59e7bdbdf4
|
7
|
+
data.tar.gz: f273b7870a878b1672857d0b2e33fb49885e29945cc3b3e6748bbbd559ce4e9b6cf044029a2f5fe5b1278d6b0c8904d4d0668f57d6a57153ae754656688cf187
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.3
|
1
|
+
ruby-2.5.3
|
data/.travis.yml
CHANGED
data/bin/rflow
CHANGED
@@ -86,6 +86,13 @@ end
|
|
86
86
|
# things, like the config database. We want those log messages to go to the
|
87
87
|
# startup log when setting up. The running log will transition to what is
|
88
88
|
# specified in the config database.
|
89
|
+
if options[:startup_log_file_path] &&
|
90
|
+
File.exist?(options[:startup_log_file_path]) &&
|
91
|
+
!File.writable?(options[:startup_log_file_path])
|
92
|
+
STDERR.puts "Startup log file '#{options[:startup_log_file_path]}' not writable"
|
93
|
+
exit 1
|
94
|
+
end
|
95
|
+
|
89
96
|
RFlow.logger.reconfigure({'rflow.application_name' => 'startup',
|
90
97
|
'rflow.log_level' => options[:startup_log_level].to_s,
|
91
98
|
'rflow.log_file_path' => options[:startup_log_file_path]}, true)
|
@@ -101,6 +108,11 @@ if options[:config_file_path] && command != 'load'
|
|
101
108
|
exit 1
|
102
109
|
end
|
103
110
|
|
111
|
+
if !options[:config_file_path] && command == 'load'
|
112
|
+
RFlow.logger.fatal "Config file required for 'load' command"
|
113
|
+
exit 1
|
114
|
+
end
|
115
|
+
|
104
116
|
unless options[:config_database_path]
|
105
117
|
RFlow.logger.warn "Config database not specified, using default 'config.sqlite'"
|
106
118
|
options[:config_database_path] = File.expand_path(File.join(Dir.getwd, 'config.sqlite'))
|
@@ -110,19 +122,18 @@ case command
|
|
110
122
|
when 'load'
|
111
123
|
# Load the database with the config file, if it exists. Will
|
112
124
|
# otherwise default values (not very useful)
|
113
|
-
if options[:config_file_path]
|
114
|
-
unless File.exist? options[:config_file_path]
|
115
|
-
RFlow.logger.fatal "Config file '#{options[:config_file_path]}' not found\n#{option_parser.help}"
|
116
|
-
exit 1
|
117
|
-
end
|
118
125
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
126
|
+
unless File.exist? options[:config_file_path]
|
127
|
+
RFlow.logger.fatal "Config file '#{options[:config_file_path]}' not found"
|
128
|
+
exit 1
|
129
|
+
end
|
130
|
+
|
131
|
+
unless File.readable? options[:config_file_path]
|
132
|
+
RFlow.logger.fatal "Config file '#{options[:config_file_path]}' not readable"
|
133
|
+
exit 1
|
123
134
|
end
|
124
135
|
|
125
|
-
if File.exist? options[:config_database_path]
|
136
|
+
if File.exist?(options[:config_database_path]) && File.size(options[:config_database_path]) > 0
|
126
137
|
RFlow.logger.fatal "Config database '#{options[:config_database_path]}' exists, exiting to prevent accidental overwrite from config file '#{options[:config_file_path]}'"
|
127
138
|
exit 1
|
128
139
|
end
|
@@ -131,11 +142,11 @@ when 'load'
|
|
131
142
|
begin
|
132
143
|
config = RFlow::Configuration::initialize_database(options[:config_database_path], options[:config_file_path])
|
133
144
|
rescue Exception => e
|
134
|
-
RFlow.logger.fatal "Error initializing configuration database: #{e.message}: #{e.backtrace.join "\n"}"
|
145
|
+
RFlow.logger.fatal "Error initializing configuration database #{options[:config_database_path]}: #{e.message}: #{e.backtrace.join "\n"}"
|
135
146
|
exit 1
|
136
147
|
end
|
137
148
|
|
138
|
-
RFlow.logger.
|
149
|
+
RFlow.logger.info "Successfully initialized database '#{options[:config_database_path]}' with '#{options[:config_file_path]}'"
|
139
150
|
RFlow.logger.debug config.to_s
|
140
151
|
exit 0
|
141
152
|
end
|
@@ -144,7 +155,11 @@ end
|
|
144
155
|
begin
|
145
156
|
config = RFlow::Configuration.new(options[:config_database_path])
|
146
157
|
rescue Exception => e
|
147
|
-
|
158
|
+
if e.is_a?(ArgumentError) && e.message =~ /Invalid schema in configuration database/
|
159
|
+
RFlow.logger.fatal "RFlow configuration database #{options[:config_database_path]} appears to be empty or missing. Perhaps you need to run 'rflow load -c <config file> -d #{options[:config_database_path]}'? (#{e.message})"
|
160
|
+
else
|
161
|
+
RFlow.logger.fatal "Error loading config database: #{e.class} - #{e.message}"
|
162
|
+
end
|
148
163
|
exit 1
|
149
164
|
end
|
150
165
|
|
@@ -191,13 +206,17 @@ end
|
|
191
206
|
options[:extensions_file_paths].each do |extensions_file_path|
|
192
207
|
RFlow.logger.info "Loading #{extensions_file_path}"
|
193
208
|
unless File.readable? extensions_file_path
|
194
|
-
RFlow.logger.fatal "Extensions file ('#{Dir.getwd}') '#{extensions_file_path}' not readable
|
209
|
+
RFlow.logger.fatal "Extensions file ('#{Dir.getwd}') '#{extensions_file_path}' not readable"
|
195
210
|
exit 1
|
196
211
|
end
|
197
212
|
begin
|
198
213
|
load extensions_file_path
|
199
214
|
rescue Exception => e
|
200
|
-
|
215
|
+
if e.is_a?(ActiveRecord::RecordInvalid)
|
216
|
+
RFlow.logger.fatal "Error running rflow: It appears you may have passed a Ruby RFlow DSL file instead of an extensions file (which loads your application code) to rflow start -e #{extensions_file_path}. Please recheck your command arguments. (#{e.class}: #{e.message})"
|
217
|
+
else
|
218
|
+
RFlow.logger.fatal "Error running rflow: #{e.class}: #{e.message}, because: #{e.backtrace}"
|
219
|
+
end
|
201
220
|
exit 1
|
202
221
|
end
|
203
222
|
end
|
data/lib/rflow/child_process.rb
CHANGED
@@ -103,7 +103,7 @@ class RFlow
|
|
103
103
|
def handle_signals
|
104
104
|
Signal.trap 'SIGCHLD', 'DEFAULT' # make sure child process can run subshells
|
105
105
|
|
106
|
-
['SIGTERM', 'SIGINT', 'SIGQUIT'].each do |signal|
|
106
|
+
['SIGTERM', 'SIGINT', 'SIGQUIT', 'SIGHUP'].each do |signal|
|
107
107
|
trap_signal(signal) do
|
108
108
|
shutdown! signal
|
109
109
|
exit! 0
|
@@ -124,7 +124,7 @@ class RFlow
|
|
124
124
|
end
|
125
125
|
|
126
126
|
def unhandle_signals
|
127
|
-
['SIGTERM', 'SIGINT', 'SIGQUIT', 'SIGCHLD', 'SIGUSR1', 'SIGUSR2', SIGINFO].each do |signal|
|
127
|
+
['SIGTERM', 'SIGINT', 'SIGQUIT', 'SIGHUP', 'SIGCHLD', 'SIGUSR1', 'SIGUSR2', SIGINFO].each do |signal|
|
128
128
|
Signal.trap signal, 'DEFAULT'
|
129
129
|
end
|
130
130
|
end
|
data/lib/rflow/daemon_process.rb
CHANGED
@@ -129,7 +129,7 @@ class RFlow
|
|
129
129
|
end
|
130
130
|
|
131
131
|
def handle_signals
|
132
|
-
['SIGTERM', 'SIGINT', 'SIGQUIT', 'SIGCHLD'].each do |signal|
|
132
|
+
['SIGTERM', 'SIGINT', 'SIGQUIT', 'SIGHUP', 'SIGCHLD'].each do |signal|
|
133
133
|
trap_signal(signal) do |return_code|
|
134
134
|
exit_status = if signal == 'SIGCHLD'
|
135
135
|
pid, status = Process.wait2
|
@@ -159,7 +159,7 @@ class RFlow
|
|
159
159
|
end
|
160
160
|
|
161
161
|
def unhandle_signals
|
162
|
-
['SIGTERM', 'SIGINT', 'SIGQUIT', 'SIGCHLD', 'SIGUSR1', 'SIGUSR2', SIGINFO].each do |signal|
|
162
|
+
['SIGTERM', 'SIGINT', 'SIGQUIT', 'SIGCHLD', 'SIGHUP', 'SIGUSR1', 'SIGUSR2', SIGINFO].each do |signal|
|
163
163
|
Signal.trap signal, 'DEFAULT'
|
164
164
|
end
|
165
165
|
end
|
data/lib/rflow/logger.rb
CHANGED
@@ -133,7 +133,9 @@ class RFlow
|
|
133
133
|
begin
|
134
134
|
internal_logger.add FileOutputter.new('rflow.log_file', :filename => log_file_path, :formatter => LOG_PATTERN_FORMATTER)
|
135
135
|
rescue Exception => e
|
136
|
-
|
136
|
+
# at least output the failure to stderr
|
137
|
+
internal_logger.add StderrOutputter.new('rflow_stderr', :formatter => LOG_PATTERN_FORMATTER)
|
138
|
+
raise ArgumentError, "Log file '#{File.expand_path log_file_path}' problem: #{e.message}"
|
137
139
|
end
|
138
140
|
end
|
139
141
|
end
|
data/lib/rflow/message.rb
CHANGED
data/lib/rflow/pid_file.rb
CHANGED
@@ -35,6 +35,10 @@ class RFlow
|
|
35
35
|
end
|
36
36
|
pid_fp = begin
|
37
37
|
File.open(tmp_path, File::RDWR|File::CREAT|File::EXCL, 0644)
|
38
|
+
rescue Errno::ENOENT => e
|
39
|
+
RFlow.logger.fatal "Error while writing temp PID file '#{tmp_path}'; containing directory may not exist?"
|
40
|
+
RFlow.logger.fatal "Exception #{e.class}: #{e.message}"
|
41
|
+
abort
|
38
42
|
rescue Errno::EACCES => e
|
39
43
|
RFlow.logger.fatal "Access error while writing temp PID file '#{tmp_path}'"
|
40
44
|
RFlow.logger.fatal "Exception #{e.class}: #{e.message}"
|
data/lib/rflow/version.rb
CHANGED
data/rflow.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_dependency 'activerecord', '~> 4.0'
|
29
29
|
|
30
30
|
s.add_dependency 'avro', '~> 1.8'
|
31
|
+
s.add_dependency 'avro-patches', '~> 0.4' # update patches to official avro
|
31
32
|
s.add_dependency 'em-zeromq', '~> 0.5'
|
32
33
|
|
33
34
|
s.add_development_dependency 'bundler', '~> 1.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Stoneham
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: uuidtools
|
@@ -95,6 +95,20 @@ dependencies:
|
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '1.8'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: avro-patches
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - "~>"
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0.4'
|
105
|
+
type: :runtime
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0.4'
|
98
112
|
- !ruby/object:Gem::Dependency
|
99
113
|
name: em-zeromq
|
100
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -281,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
295
|
version: '0'
|
282
296
|
requirements: []
|
283
297
|
rubyforge_project:
|
284
|
-
rubygems_version: 2.
|
298
|
+
rubygems_version: 2.7.8
|
285
299
|
signing_key:
|
286
300
|
specification_version: 4
|
287
301
|
summary: A Ruby flow-based programming framework
|