adding resilience4j-retry to integration tests #100
ronreynolds
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i keep seeing ITs failing with "com.smartsheet.api.ResourceNotFoundException: Not Found" after the creation of something (typically a Sheet or Folder) and the immediately subsequent attempt to use the ID returned from the server. i suspect this is a lag between creation of a resource by 1 server and its subsequent visibility to other servers/services. in the case of app-core it would normally trigger a cache miss and subsequent read from the DB but it's possible it's not a cache miss as much as replication delay between the writable primary grid-shard and the read-only replica grid-shards.
the cleanest way i can think of at the moment is to add resilience4j-retry around those subsequent calls to add retry with backoff. resilience4j is the successor of Netflix-Hystrix and, last i checked, is the best-in-breed solution to this sort of problem. details about it are here - https://resilience4j.readme.io/docs/retry and i'm going to add it to one of my branches that are currently failing due in the IT stage in the above way.
i had considered adding a simple Resilience util class with a retry() method taking a lambda to the Smartsheet Callable and a few settings but this wouldn't be something SDK users could grab off the shelf (as we don't currently have a non-internal (i.e., public) util package in the SDK and Res4J is maintained and it'll work with the OpenAPI version and it's almost certainly better in almost every way than whatever i would write in a pinch.
opinions very much welcome. :)
Beta Was this translation helpful? Give feedback.
All reactions