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 +4 -4
- data/CHANGELOG.md +16 -0
- data/lib/ductwork/dsl/definition_builder.rb +0 -1
- data/lib/ductwork/models/job.rb +3 -3
- data/lib/ductwork/processes/job_worker.rb +3 -3
- data/lib/ductwork/processes/job_worker_runner.rb +3 -3
- data/lib/ductwork/processes/pipeline_advancer.rb +2 -3
- data/lib/ductwork/processes/pipeline_advancer_runner.rb +1 -1
- data/lib/ductwork/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aeafd6691af4722e01b18aefa76b2bd5ae75abe5930e0d7ab1a43593aba80010
|
|
4
|
+
data.tar.gz: 15ad867b7f98d0e3372b3e9f5a960964305df8f16da48a7273c4413f73f58c76
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/ductwork/models/job.rb
CHANGED
|
@@ -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 >=
|
|
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, :
|
|
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
|
-
@
|
|
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
|
-
@
|
|
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.
|
|
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
|
|
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
|
|
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
|
data/lib/ductwork/version.rb
CHANGED