Commit 2d938b9
[extension/apmconfig] save RemoteConfigStatus.LastRemoteConfigHash regardless of status (#609)
* [extension/apmconfig] save RemoteConfigStatus.LastRemoteConfigHash regardless of status
Before this change the OpAMP server would only store the LastRemoteConfigHash
provided in an AgentToServer message if the RemoteConfigStatus.Status
was "APPLIED".
An agent may want to (a) acknowledge that a particular config was
received (via LastRemoteConfigHash) *and* (b) provide some other status
(APPLYING or FAILED). In my particular case, for EDOT Node.js, I want to
be able to support the case where the server might be sending new config
names that an older EDOT Node.js might not know about. My
RemoteConfigStatus in this case is:
LastRemoteConfigHash: ...
Status=FAILED
ErrorMessage="there were issues applying remote config: config name 'some_new_var' is unsupported"
The downside of the current behaviour is that the server will ignore the
provided LastRemoteConfigHash and continue to re-send the same remote
config in every ServerToAgent. Re-sending is not going to fix the issue
the agent had with applying the config.
My interpretation of the OpAMP spec and proto is that the OpAMP server
should use *only* the LastRemoteConfigHash field for determining if
RemoteConfig should be sent. The proto says:
// The hash of the remote config that was last received by this Agent in the
// AgentRemoteConfig.config_hash field.
// The Server SHOULD compare this hash with the config hash
// it has for the Agent and if the hashes are different the Server MUST include
// the remote_config field in the response in the ServerToAgent message.
* fix test case
* ensure we save RemoteConfigStatus before a possible early return
* add a test case for the RemoteConfigStatuses_FAILED case
---------
Co-authored-by: Roger Coll <[email protected]>1 parent eb327f9 commit 2d938b9
File tree
2 files changed
+37
-13
lines changed- extension/apmconfigextension
2 files changed
+37
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
| |||
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 141 | + | |
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
188 | 192 | | |
189 | 193 | | |
190 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
191 | 213 | | |
192 | 214 | | |
193 | 215 | | |
| |||
0 commit comments