Skip to content

Conversation

@gbtami
Copy link
Owner

@gbtami gbtami commented Nov 25, 2025

Implement retry db wrapper to let server “ride out” brief one node only DigitalOcean MongoDB restarts without crashing requests.

- Add support for additional retryable exceptions (NotPrimaryError, CursorNotFound, etc.)
- Implement smart OperationFailure handling by error code and labels
- Add comprehensive tests for retryable error scenarios
- Maintain backward compatibility with existing functionality
- Remove redundant hasattr(exception, "details") duplicate
- Clean up function logic for better readability
- Create RETRYABLE_ERROR_CODES constant for shared use
- Remove duplicate retryable_codes definitions
- Improve maintainability and readability
- Add comprehensive list of retryable OperationFailure error codes
- Include additional codes like StaleShardVersion (63), StaleEpoch (150), StaleConfig (13388)
- Add ExceededTimeLimit (262) and RetryChangeStream (234) codes
- Update tests to include new retryable error codes
- Focus on error codes relevant to single-node DigitalOcean MongoDB
- Remove replica set specific codes (10107, 11600, 11602, 13435, 13436, 63, 150, 13388, 234)
- Keep network/connection related codes: 6, 7, 89, 91, 9001, 262, 64
- Include 189 (PrimarySteppedDown) for broader compatibility
- Update tests accordingly
@gbtami gbtami merged commit a1bf244 into master Nov 26, 2025
11 checks passed
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.

2 participants