Handle unreliable caching#113
Conversation
| _isNewSessionKey = isNewSessionKey; | ||
| } | ||
|
|
||
| public bool IsAvailable { private set; get; } |
There was a problem hiding this comment.
This needs to be moved to ISession in HttpAbstractions.
|
cc @Tratcher |
| _loaded = true; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
I think we can remove TODO item on the like below since that's what we will go with. Same with the method Deserialize where we will not throw since it's self healing by creating a new session. ReadBytes may still fail due to corrupted cache but that exception will be caught in Load.
|
Offline discussion: set a dummy store in the Load failure case so you don't have to check IsAvailable in every method. |
6fd6560 to
ccad490
Compare
|
🆙📅 |
| catch (Exception exception) | ||
| { | ||
| _logger.SessionCacheReadException(_sessionKey, exception); | ||
| return; |
There was a problem hiding this comment.
Don't return here, this isn't fatal. Try the commit and let that fail.
There was a problem hiding this comment.
That works but you get two exceptions instead of one logged. I guess the duplication there isn't a problem.
There was a problem hiding this comment.
Depending on how transient the error is, commit may succeed.
|
🆙📅 |
|
|
7eaea2b to
d61c510
Compare
#99 swallow exceptions caused by unreliable cache operations and log them. Will open issue on Caching for more reliable cache operations, retry logic ...