Commit b260205
authored
chore: Add a timer to avoid repeated debug logs (#954)
## Problem
When the Lambda runtime spins down, the extension may enter a loop
waiting for unfinished work, printing up to 100,000s identical lines of
log:
> LOGS_AGENT | No more events to process but still have senders,
continuing to drain...
For example, in one of my tests, this line was printed 31602 times
within 1.28 seconds.
<img width="1097" height="344" alt="image"
src="https://github.com/user-attachments/assets/b3aff30c-596f-4837-a081-fbe165ba6254"
/>
This:
1. slightly complicates debugging for our engineers
2. adds costs and confusion for customers who turn on
`DD_LOG_LEVEL=debug` to debug the extension
## This PR
Add a timer and print this line at most once every 100ms, so it will be
printed at most 20 times within the 2-second spindown time.
## Testing
No testing for now. Should be straightforward. Will see if logs are
reduced in future debugging.1 parent 0d69a7b commit b260205
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| |||
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
71 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
0 commit comments