ductwork 0.11.0 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8865aef62511e2f94cd1400996127785cc5d46d9f2b16b00685145308addae3
4
- data.tar.gz: f46683206d866c499f6f7eec03b5334038c77cf4078c7f78e150de11bd40b582
3
+ metadata.gz: aeafd6691af4722e01b18aefa76b2bd5ae75abe5930e0d7ab1a43593aba80010
4
+ data.tar.gz: 15ad867b7f98d0e3372b3e9f5a960964305df8f16da48a7273c4413f73f58c76
5
5
  SHA512:
6
- metadata.gz: '08b1731d7f186650a6de90dad1b3ec3f797bddd55f03aab5d1812b7cf1476ec563d3f74537b04622778d3e3cd41afae2b38152805aa6d4d796764469f72703e7'
7
- data.tar.gz: 6cc3908017094ad58f96c6db69cafca8b585e6f45217821f27559a7a7e47f59b8017a4d0fc87af4ea83286aa1aa0502b42d0159c2e1f6e54535296cecdd8149e
6
+ metadata.gz: 2a7df95cb4335e77d71f08bdfa1d0bb029fc651f458a129d4ccfd7b447d484fe780517a5e64280f242a0e52a6414385bdbb5b45bb14417c96d39d9fb017936c5
7
+ data.tar.gz: c9d5d363580913ca51869a7ff8df6d2c02dae61de6aa064eac2f8c9ab5f7199b0ed91f2858fe7c8ea62d110f7e201e0cf2ba60cf202b294c7c729a3e8dc75802
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Ductwork Changelog
2
2
 
3
+ ## [0.11.2]
4
+
5
+ - fix: join error backtrace lines before persisting in `text` column
6
+ - fix: use computed `max_retry` when determining job retry
7
+ - fix: protect against a possible null `status` when advancing a pipeline
8
+ - fix: correct spelling of `last_heartbeat_at` variable
9
+ - fix: flip inverted deadline check in job worker runner
10
+ - fix: flip inverted deadline check in pipeline advancer runner
11
+ - fix: reference `thread` variable from `job_worker`, not top-level
12
+ - fix: remove unnecessary, erroneous line in definition builder
13
+
14
+ ## [0.11.1]
15
+
16
+ - fix: use info-level for job worker restart log messages
17
+ - fix: use "killed" result in job execution log message when job worker is restarted
18
+
3
19
  ## [0.11.0]
4
20
 
5
21
  - feat: expose `job` attribute during claim and execution in job worker
@@ -180,7 +180,6 @@ module Ductwork
180
180
  to = klasses.map { |klass| "#{klass.name}.#{stages.length}" }
181
181
  definition[:edges][last_node][:to] = to
182
182
  definition[:edges][last_node][:type] = type
183
- definition[:edges][last_node][:klass] ||= klass
184
183
  end
185
184
  end
186
185
 
@@ -123,7 +123,7 @@ module Ductwork
123
123
  pipeline: pipeline,
124
124
  job_id: id,
125
125
  job_klass: klass,
126
- result: result,
126
+ result: result || "killed",
127
127
  role: :job_worker
128
128
  )
129
129
  end
@@ -163,7 +163,7 @@ module Ductwork
163
163
  result_type: "failure",
164
164
  error_klass: error.class.to_s,
165
165
  error_message: error.message,
166
- error_backtrace: error.backtrace
166
+ error_backtrace: error.backtrace.join("\n")
167
167
  )
168
168
 
169
169
  if execution.retry_count < max_retry
@@ -174,7 +174,7 @@ module Ductwork
174
174
  new_execution.create_availability!(
175
175
  started_at: FAILED_EXECUTION_TIMEOUT.from_now
176
176
  )
177
- elsif execution.retry_count >= Ductwork.configuration.job_worker_max_retry
177
+ elsif execution.retry_count >= max_retry
178
178
  halted = true
179
179
 
180
180
  step.update!(status: :failed)
@@ -3,14 +3,14 @@
3
3
  module Ductwork
4
4
  module Processes
5
5
  class JobWorker
6
- attr_reader :thread, :last_hearthbeat_at, :job
6
+ attr_reader :thread, :last_heartbeat_at, :job
7
7
 
8
8
  def initialize(pipeline, id)
9
9
  @pipeline = pipeline
10
10
  @id = id
11
11
  @running_context = Ductwork::RunningContext.new
12
12
  @thread = nil
13
- @last_hearthbeat_at = Time.current
13
+ @last_heartbeat_at = Time.current
14
14
  end
15
15
 
16
16
  def start
@@ -67,7 +67,7 @@ module Ductwork
67
67
  sleep(polling_timeout)
68
68
  end
69
69
 
70
- @last_hearthbeat_at = Time.current
70
+ @last_heartbeat_at = Time.current
71
71
  end
72
72
 
73
73
  Ductwork.logger.debug(
@@ -85,7 +85,7 @@ module Ductwork
85
85
  if !job_worker.alive?
86
86
  job_worker.restart
87
87
 
88
- Ductwork.logger.debug(
88
+ Ductwork.logger.info(
89
89
  msg: "Restarted thread",
90
90
  role: :job_worker_runner,
91
91
  pipeline: pipeline
@@ -126,7 +126,7 @@ module Ductwork
126
126
 
127
127
  while Time.current < deadline && job_workers.any?(&:alive?)
128
128
  job_workers.each do |job_worker|
129
- break if Time.current < deadline
129
+ break if Time.current > deadline
130
130
 
131
131
  # TODO: Maybe make this configurable. If there's a ton of workers
132
132
  # it may not even get to the "later" ones depending on the timeout
@@ -142,7 +142,7 @@ module Ductwork
142
142
  Ductwork.logger.debug(
143
143
  msg: "Killed thread",
144
144
  role: :job_worker_runner,
145
- thread: thread.name
145
+ thread: job_worker.thread.name
146
146
  )
147
147
  end
148
148
  end
@@ -56,15 +56,14 @@ module Ductwork
56
56
  # rubocop:todo Metrics/BlockNesting
57
57
  status = pipeline.completed? ? "completed" : "in_progress"
58
58
  # rubocop:enable Metrics/BlockNesting
59
-
59
+ ensure
60
60
  # release the pipeline and set last advanced at so it doesn't
61
61
  # block. we're not using a queue so we have to use a db
62
62
  # timestamp
63
- ensure
64
63
  pipeline.update!(
65
64
  claimed_for_advancing_at: nil,
66
65
  last_advanced_at: Time.current,
67
- status: status
66
+ status: status || "in_progress"
68
67
  )
69
68
  end
70
69
  else
@@ -125,7 +125,7 @@ module Ductwork
125
125
  )
126
126
  while Time.current < deadline && threads.any?(&:alive?)
127
127
  threads.each do |thread|
128
- break if Time.current < deadline
128
+ break if Time.current > deadline
129
129
 
130
130
  # TODO: Maybe make this configurable. If there's a ton of workers
131
131
  # it may not even get to the "later" ones depending on the timeout
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ductwork
4
- VERSION = "0.11.0"
4
+ VERSION = "0.11.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ductwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Ewing