You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're returning null/empty responses when HttpClient calls fail, causing these data to be cached. See discussion.
Reproduction
All infrastructure clients used for lookups (with the possible exception ofOrganizationRegistryClient) will return null or empty results upon any intermittent error. FusionCache will then happily cache those responses as valid results, and API callers won't be able to distinguish actual empty results with intermittent upstream failure.
Expected behavior
If the remote server is down (ie. we get some sort of socket/connection error), non-successful response codes or the returned data fails to unserialize to the expected model, an exception should be thrown. This will be caught by the FailSafe mechanism in FusionCache, which will reuse the stale data and attempt a new request after FailSafeThrottleDuration has elapsed. The actual request should use Polly with a retry (and perhaps backoff).
If no stale data is available, or if FailSafeMaxDuration is reached, the exception should bubble up and result in a 502 Bad Gateway to indicate to clients that something upstream is down. Exceptions should be logged / alerted as normally.
Actual behavior
No exceptions are thrown, and misbehaving upstream services cause empty/null results to be returned, which might cause confusion ("why is my inbox empty all of a sudden?")
The text was updated successfully, but these errors were encountered:
… expectations (#684)
## Description
This fixes#671 by implementing a wrapper via extension methods that
causes post/get requests that don't return a successful message to throw
exceptions.
## Related Issue(s)
- #671
## Verification
- [x] **Your** code builds clean without any errors or warnings
- [x] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)
## Documentation
- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)
---------
Co-authored-by: Ole Jørgen Skogstad <skogstad@softis.net>
Description
We're returning null/empty responses when HttpClient calls fail, causing these data to be cached. See discussion.
Reproduction
All infrastructure clients used for lookups (with the possible exception of
OrganizationRegistryClient
) will return null or empty results upon any intermittent error. FusionCache will then happily cache those responses as valid results, and API callers won't be able to distinguish actual empty results with intermittent upstream failure.Expected behavior
If the remote server is down (ie. we get some sort of socket/connection error), non-successful response codes or the returned data fails to unserialize to the expected model, an exception should be thrown. This will be caught by the FailSafe mechanism in FusionCache, which will reuse the stale data and attempt a new request after
FailSafeThrottleDuration
has elapsed. The actual request should use Polly with a retry (and perhaps backoff).If no stale data is available, or if
FailSafeMaxDuration
is reached, the exception should bubble up and result in a502 Bad Gateway
to indicate to clients that something upstream is down. Exceptions should be logged / alerted as normally.Actual behavior
No exceptions are thrown, and misbehaving upstream services cause empty/null results to be returned, which might cause confusion ("why is my inbox empty all of a sudden?")
The text was updated successfully, but these errors were encountered: