Commit 14ba9bb
chore: add pre-push hook for cargo fmt and clippy (#130)
* chore: add pre-push hook for cargo fmt and clippy
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* fix: remove unnecessary u32 casts flagged by clippy
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* fix: apply cargo fmt formatting
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* fix: collapse nested if block flagged by clippy
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* chore: treat clippy warnings as errors in CI and document pre-push hook
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
* fix: bias mini_agent serve() select toward shutdown over task exits
When shutdown_tx fires, each transport accept loop sees shutdown_rx,
drains its joinset, and returns Ok(()). Both the accept loop's
JoinHandle and the supervisor's shutdown_rx.changed() then become ready
in the same poll cycle. Without biased, the unbiased select! in serve()
would pick a *Died arm at random, return Err(...), and abort everything
without firing flusher_shutdown_tx — so the stats flusher's shutdown
branch never ran and no final stats POST happened. This made
test_mini_agent_*_with_real_flushers intermittently time out at 60s
waiting for /api/v0.2/stats; CI run 25562651282 captured the smoking
gun "Event::PipeDied: Ok(Ok(()))".
biased; with shutdown_rx.changed() listed first guarantees Event::Shutdown
wins whenever the shutdown signal is observable, so the supervisor always
takes the graceful-flush path even if the accept loops happen to resolve
first. Production main.rs never sends on shutdown_tx, so this is purely
a test-only path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent cb3a20b commit 14ba9bb
6 files changed
Lines changed: 48 additions & 15 deletions
File tree
- .githooks
- .github/workflows
- crates
- datadog-trace-agent
- src
- tests
- dogstatsd/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
298 | 303 | | |
| 304 | + | |
| 305 | + | |
299 | 306 | | |
300 | 307 | | |
301 | 308 | | |
302 | 309 | | |
303 | 310 | | |
304 | | - | |
305 | 311 | | |
306 | 312 | | |
307 | 313 | | |
| |||
322 | 328 | | |
323 | 329 | | |
324 | 330 | | |
| 331 | + | |
325 | 332 | | |
| 333 | + | |
| 334 | + | |
326 | 335 | | |
327 | 336 | | |
328 | 337 | | |
329 | 338 | | |
330 | | - | |
331 | 339 | | |
332 | 340 | | |
333 | 341 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
313 | 314 | | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
| 315 | + | |
319 | 316 | | |
320 | 317 | | |
321 | 318 | | |
322 | | - | |
| 319 | + | |
323 | 320 | | |
324 | 321 | | |
325 | 322 | | |
| |||
0 commit comments