-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit retry attempts in SIRI-SX updater #5264
Limit retry attempts in SIRI-SX updater #5264
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5264 +/- ##
=============================================
+ Coverage 65.90% 65.93% +0.02%
- Complexity 14783 14804 +21
=============================================
Files 1770 1773 +3
Lines 68680 68743 +63
Branches 7276 7278 +2
=============================================
+ Hits 45264 45324 +60
Misses 20932 20932
- Partials 2484 2487 +3
☔ View full report in Codecov by Sentry. |
5a2f0f7
to
151deec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just minor stuff. I looked at the resilience4j as you mentioned, but it look a bit overkill for this :-)
Summary
The SIRI-SX updater retries an indefinite number of times when it fails to retrieve data from the SIRI-SX server. This approach is problematic when using a scheduled thread pool where each task is expected to complete briefly and return the thread to the pool.
This PR adapts the retry logic so that SIRI requests are retried a limited number of times during each polling.
Note: The Apache HTTP client library retries by default all idempotent HTTP operations (GET, ...) for a limited list of IOExceptions (see https://www.baeldung.com/java-retrying-requests-using-apache-httpclient).
The HTTP request sent by the SIRI-SX updater is a POST operation and is not retried by default. This is the correct behavior since this request is indeed not idempotent: the server replies with the list of new messages published since the previous request.
Issue
No
Unit tests
Added unit tests
Documentation
No