Add exponential backoff for process restarts#76
Conversation
Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
|
@copilot Have a look at this ci error Process restart with exponential backoff => ./test/core/restart-backoff.test.ts:13:1 Process restart without backoff (default behavior) => ./test/core/restart-backoff.test.ts:80:1 FAILURES Process restart with exponential backoff => ./test/core/restart-backoff.test.ts:13:1 FAILED | 41 passed | 2 failed (8s) error: Test failed |
Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
Fixed in ed816d4. The tests were failing because they didn't account for the watchdog interval (1 second). The watchdog checks process status every 1s before applying restart delays, so tests need to wait at least 1.5s between checks to observe restarts. Updated all timing in the tests accordingly. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Single Best Improvement to Pup: Add Exponential Backoff for Process Restarts
This PR implements exponential backoff for process restarts to prevent rapid restart loops when processes fail repeatedly.
✅ Completed Tasks:
📝 Implementation Details
Configuration Added:
restartBackoffMs(0 to 86,400,000 ms)Algorithm:
Example Behavior:
With
restartDelayMs: 1000andrestartBackoffMs: 30000:📦 Files Modified
restartBackoffMsparameter🎯 Benefits
restartLimitfor robust error handling🔒 Security & Quality
🧪 Test Fix
The tests were failing because they didn't account for the watchdog interval (1 second). The watchdog checks process status every second, then waits for the restart delay before restarting. Updated test timing to:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.