Skip to content

feat: add auto-reconnect with exponential backoff for DingTalk stream#341

Open
nap-liu wants to merge 1 commit intodataelement:mainfrom
nap-liu:pr/dingtalk-auto-reconnect
Open

feat: add auto-reconnect with exponential backoff for DingTalk stream#341
nap-liu wants to merge 1 commit intodataelement:mainfrom
nap-liu:pr/dingtalk-auto-reconnect

Conversation

@nap-liu
Copy link
Copy Markdown

@nap-liu nap-liu commented Apr 8, 2026

Summary

  • Max 5 retries with delays: 2s, 5s, 15s, 30s, 60s
  • Retry counter resets on successful connection
  • Uses stop_event.wait(timeout) for graceful shutdown during backoff
  • Logs each connection attempt

Test plan

  • DingTalk E2E: connection logs show "attempt 1/6" on each restart

Wrap the DingTalk Stream client run loop with retry logic so dropped
connections are automatically re-established instead of silently dying.

- Max 5 retries per client with delays of 2s, 5s, 15s, 30s, 60s
- Log each reconnection attempt and permanent failure
- Use stop_event.wait() for backoff so graceful shutdown is immediate

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant