Commit 281a643
fix(control-plane): retry handler errors with exponential backoff in informer (#1182)
## Summary
- Transient errors (e.g. TSA RoleBinding not yet propagated when the
project reconciler runs `ensureRunnerSecrets`) caused events to be
permanently dropped — the informer logged the error and moved on with no
retry.
- Add a `retryLoop` goroutine alongside `dispatchLoop`. Failed handlers
are requeued onto a buffered `retryCh` with exponential backoff: 2s → 4s
→ 8s → 16s → 30s (cap).
- After `retryMaxAttempts` (5) the error is logged as permanent.
- Fixes the race where a newly-created project namespace's TSA
`RoleBinding` isn't propagated by the time `ensureRunnerSecrets` runs.
## Test plan
- [ ] Create a new project — CP logs should show `namespace provisioned`
and `ambient-runner-secrets created` without permanent failure
- [ ] If a transient forbidden error occurs, CP logs should show
`handler failed, will retry` with `attempt` and `retry_in` fields,
followed by eventual success
- [ ] After 5 failed attempts, CP logs `handler failed after max
retries`
🤖 Generated with [Claude Code](https://claude.ai/code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
## Release Notes
* **New Features**
* Added credential management support: create, delete, view, and list
credentials
* Added JSON output format flag to agent start command
* Added GitHub integration demo script for end-to-end workflow testing
* **Improvements**
* Enhanced event handler resilience with exponential backoff retry logic
* Improved namespace cleanup handling during project deletion
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Ambient Code Bot <bot@ambient-code.local>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 8ad69d4 commit 281a643
1 file changed
Lines changed: 70 additions & 11 deletions
Lines changed: 70 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
81 | 94 | | |
82 | 95 | | |
83 | 96 | | |
84 | 97 | | |
85 | 98 | | |
86 | 99 | | |
87 | 100 | | |
| 101 | + | |
88 | 102 | | |
89 | 103 | | |
90 | 104 | | |
| |||
98 | 112 | | |
99 | 113 | | |
100 | 114 | | |
| 115 | + | |
101 | 116 | | |
102 | 117 | | |
103 | 118 | | |
| |||
118 | 133 | | |
119 | 134 | | |
120 | 135 | | |
| 136 | + | |
121 | 137 | | |
122 | 138 | | |
123 | 139 | | |
| |||
133 | 149 | | |
134 | 150 | | |
135 | 151 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
147 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
148 | 207 | | |
149 | 208 | | |
150 | 209 | | |
| |||
0 commit comments