Skip to content

Conversation

seungy0
Copy link

@seungy0 seungy0 commented Oct 9, 2025

related issue: #4567

Auto-configured retry template now aligns with builder defaults by retrying on pre-response network exceptions. Previously, network connectivity errors like connection timeouts and connection refused were not retried in the auto-configuration path, causing inconsistent resilience behavior compared to the builder defaults.

Problem

  • Auto-configured RetryTemplate only retried on TransientAiException (HTTP-status-based)
  • Pre-response network failures (e.g., ResourceAccessException, WebClientRequestException) bypassed ResponseErrorHandler and were not retried
  • This created inconsistent resilience behavior between auto-configuration and builder paths
  • Applications using auto-configuration experienced immediate failures on transient network issues

Solution

  • Added ResourceAccessException to retryable exceptions in auto-configured RetryTemplate
  • Added optional WebClientRequestException retry support when WebFlux is present (via reflection)
  • Maintained existing backoff/listener behavior and ResponseErrorHandler logic
  • Used reflection to avoid hard dependency on WebFlux

Impact

✅ Aligns auto-config retry behavior with RetryUtils.DEFAULT_RETRY_TEMPLATE
✅ Retries pre-response network exceptions (connection timeouts, connection refused)
✅ Optional WebFlux support without hard dependency
✅ Maintains existing retry behavior for TransientAiException
✅ No breaking changes - purely additive retry behavior
✅ Comprehensive unit tests added for all scenarios

Extends the retry configuration to include `ResourceAccessException`
and, if available, `WebClientRequestException` to handle transient
network errors during AI service calls more effectively. This improves
the resilience of the application when interacting with potentially
unstable AI services.

Signed-off-by: Seunggyu Lee <[email protected]>
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M4 milestone Oct 9, 2025
Signed-off-by: Seunggyu Lee <[email protected]>
@seungy0 seungy0 force-pushed the network-exception-retry branch from 63b7c5c to 9d1eb67 Compare October 9, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants