config_o_mat 0.5.9 → 0.5.10
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 +8 -0
- data/CLAUDE.md +2 -1
- data/Gemfile.lock +1 -1
- data/lib/config_o_mat/configurator/cond/{retries_left.rb → recovery_action.rb} +9 -8
- data/lib/config_o_mat/configurator/op/next_tick.rb +5 -2
- data/lib/config_o_mat/configurator.rb +4 -3
- data/lib/config_o_mat/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 696068a23afd014f18fc1a68b693f903ddc20924b8c72e121791a0d3e596cfae
|
|
4
|
+
data.tar.gz: 61c15620de248bde6221f32241291538d1775a5b36c03f47ae5ae1f1a7fdb379
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 800fe380aa5597db8391093ec6b67d1c9a04789b133c15fe2fc1a95f8274197e0df3b4852e489ff700e5dd3254293d2ffd56179e1d9c127371cab5290b04d33b
|
|
7
|
+
data.tar.gz: c5ffbed894b7fdd48930bc9b6337a584fef51726b5d2504259adf5f9d6fd0a90dbb5a5abd5a718490bb9c440a0541af2a210778f4986ae65dbefa9c1a75b9283
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 0.5.10
|
|
2
|
+
|
|
3
|
+
BUG FIXES:
|
|
4
|
+
|
|
5
|
+
* A running configurator no longer exits when a refresh fails (an AppConfig throttle or 5xx with no S3 fallback, or a
|
|
6
|
+
secrets load failure). It logs `refresh_failed` at `error` and tries again after `refresh_interval`. A failure on
|
|
7
|
+
first run still exits.
|
|
8
|
+
|
|
1
9
|
## 0.5.9
|
|
2
10
|
|
|
3
11
|
BUG FIXES:
|
data/CLAUDE.md
CHANGED
|
@@ -107,7 +107,8 @@ Services can use different restart strategies:
|
|
|
107
107
|
|
|
108
108
|
The Configurator VM includes retry logic:
|
|
109
109
|
- On first run, any operation failure causes the VM to fail immediately
|
|
110
|
-
- After first run,
|
|
110
|
+
- After first run, a failed profile apply retries with exponential backoff; a failed refresh logs `refresh_failed` and
|
|
111
|
+
waits for the next `refresh_interval`
|
|
111
112
|
- Configurable via `retry_count` and `retry_wait` in config files
|
|
112
113
|
- Failed profile refreshes can roll back to previous working version
|
|
113
114
|
- A render failure while applying a new AppConfig version logs `profile_render_failed` (application, environment,
|
data/Gemfile.lock
CHANGED
|
@@ -18,25 +18,26 @@ require 'lifecycle_vm/cond_base'
|
|
|
18
18
|
|
|
19
19
|
module ConfigOMat
|
|
20
20
|
module Cond
|
|
21
|
-
class
|
|
21
|
+
class RecoveryAction < LifecycleVM::CondBase
|
|
22
22
|
reads :error_op, :retries_left, :applying_profile
|
|
23
23
|
|
|
24
|
+
# @return [:retry, :resume, :fail]
|
|
24
25
|
def call
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
# If we aren't currently applying a profile then there's nothing for us to retry.
|
|
26
|
+
# After first run, only a refresh fails with no profile being applied. The next refresh tries again.
|
|
28
27
|
if applying_profile.nil?
|
|
29
|
-
logger&.error(:
|
|
30
|
-
return
|
|
28
|
+
logger&.error(:refresh_failed, state: error_op.state_name, op: error_op.op.name, errors: error_op.errors)
|
|
29
|
+
return :resume
|
|
31
30
|
end
|
|
32
31
|
|
|
32
|
+
logger&.error(:retry_from_failure, state: error_op.state_name, op: error_op.op.name, errors: error_op.errors)
|
|
33
|
+
|
|
33
34
|
# If we're out of retries, well, no more retrying
|
|
34
35
|
if retries_left.zero?
|
|
35
36
|
logger&.error(:cannot_retry, reason: 'out of retries')
|
|
36
|
-
return
|
|
37
|
+
return :fail
|
|
37
38
|
end
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
:retry
|
|
40
41
|
end
|
|
41
42
|
end
|
|
42
43
|
end
|
|
@@ -24,7 +24,7 @@ module ConfigOMat
|
|
|
24
24
|
PAUSE_INTERVAL = 1
|
|
25
25
|
|
|
26
26
|
reads :last_refresh_time, :refresh_interval, :run_count, :retry_count, :gc_stat, :gc_compact
|
|
27
|
-
writes :next_state, :run_count, :retries_left
|
|
27
|
+
writes :next_state, :run_count, :retries_left, :last_refresh_time
|
|
28
28
|
|
|
29
29
|
def call
|
|
30
30
|
self.run_count += 1
|
|
@@ -47,8 +47,11 @@ module ConfigOMat
|
|
|
47
47
|
# I'm calling Kernel.sleep directly so that tests can easily stub it out.
|
|
48
48
|
Kernel.sleep PAUSE_INTERVAL
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
now = Time.now.to_i
|
|
51
|
+
if now - last_refresh_time > refresh_interval
|
|
51
52
|
self.next_state = :refreshing_profiles
|
|
53
|
+
# Stored here too because a failed refresh doesn't write memory, and the next try should wait an interval.
|
|
54
|
+
self.last_refresh_time = now
|
|
52
55
|
else
|
|
53
56
|
self.next_state = :running
|
|
54
57
|
end
|
|
@@ -107,10 +107,11 @@ module ConfigOMat
|
|
|
107
107
|
when: {
|
|
108
108
|
true => :fail,
|
|
109
109
|
false => {
|
|
110
|
-
case: Cond::
|
|
110
|
+
case: Cond::RecoveryAction,
|
|
111
111
|
when: {
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
retry: { do: Op::WaitRetry, then: :refreshing_profile },
|
|
113
|
+
resume: :running,
|
|
114
|
+
fail: :fail
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
117
|
}
|
data/lib/config_o_mat/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: config_o_mat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Scarborough
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-12-
|
|
11
|
+
date: 2026-12-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: aws-sdk-appconfig
|
|
@@ -202,7 +202,7 @@ files:
|
|
|
202
202
|
- lib/config_o_mat/configurator/cond/first_run.rb
|
|
203
203
|
- lib/config_o_mat/configurator/cond/next_state.rb
|
|
204
204
|
- lib/config_o_mat/configurator/cond/profiles_to_apply.rb
|
|
205
|
-
- lib/config_o_mat/configurator/cond/
|
|
205
|
+
- lib/config_o_mat/configurator/cond/recovery_action.rb
|
|
206
206
|
- lib/config_o_mat/configurator/cond/services_to_reload.rb
|
|
207
207
|
- lib/config_o_mat/configurator/memory.rb
|
|
208
208
|
- lib/config_o_mat/configurator/op.rb
|