Closed khoavn closed 2 years ago
Hello @khoavn ,
Thanks for taking the time to report this issue!
I have confirmed the following two cases in which the IdempotentAPI didn't respond as expected. For that reason, I made some corrections and improvements.
CacheOnlySuccessResponses
attribute option to set it per case.409 Conflict
response in the subsequent requests. Thus, I have made a fix to remove the in-flight request on exceptions.However, as long as a request is in the inflight mode (running), all other requests will still get a 409 Conflict
response. For that reason, we should be careful when configuring the request timeout.
Could you please try the 1.0.2-prerelease-01
versions of the IdempotentAPI library and set the CacheOnlySuccessResponses
attribute option to true
, for example:
[Idempotent(CacheOnlySuccessResponses = true)]
public class WeatherForecastController : ControllerBase
{
// ...
}
Hi @ikyriak,
Apologies for the delayed response. After upgrading I get this message:
Unhandled exception. System.TypeLoadException: Method 'Remove' in type 'IdempotentAPI.Cache.FusionCache.IdempotencyFusionCache' from assembly 'IdempotentAPI.Cache.FusionCache, Version=1.0.1.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
when call AddIdempotentAPIUsingFusionCache
method.
Hello @khoavn,
Oops! Sorry, I didn't publish the 1.0.2-prerelease-01
version of the IdempotentAPI.Cache.FusionCache
library 😄.
You can find all the pre-release versions here. Can you please try to update all the IdempotentAPI libraries that you use to 1.0.2-prerelease-01
?
Thank you, it works now, but could we default CacheOnlySuccessResponses
to true
? I can't find cases where caching Controller crash useful.
Hello @khoavn,
We have set the default value of CacheOnlySuccessResponses
to true
in the v2.0.0-RC.01 release 🎆🎉. Thank you again for reporting this issue 🙏.
I have 2 services, A and B and A calls B to create objects, and I use Polly to retry requests sent by A. The problem is when B crashed why processing request from A then Polly retries with same IdempotencyKey and it get 409 response instead re-run action method of B. Should we capture request/response only when request completed successfully? What should I do in this case?