-
Notifications
You must be signed in to change notification settings - Fork 66
Conversation
@@ -71,46 +71,77 @@ public class DistributedSession : ISession | |||
_isNewSessionKey = isNewSessionKey; | |||
} | |||
|
|||
public bool IsAvailable { private set; get; } |
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.
This needs to be moved to ISession
in HttpAbstractions
.
cc @Tratcher |
} | ||
_loaded = true; | ||
} | ||
} | ||
|
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't return here, this isn't fatal. Try the commit and let that fail.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ...