Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Handle unreliable caching#113

Closed
JunTaoLuo wants to merge 0 commit into
devfrom
johluo/unreliable-storage
Closed

Handle unreliable caching#113
JunTaoLuo wants to merge 0 commit into
devfrom
johluo/unreliable-storage

Conversation

@JunTaoLuo

@JunTaoLuo JunTaoLuo commented May 18, 2016

Copy link
Copy Markdown
Contributor

#99 swallow exceptions caused by unreliable cache operations and log them. Will open issue on Caching for more reliable cache operations, retry logic ...

_isNewSessionKey = isNewSessionKey;
}

public bool IsAvailable { private set; get; }

Copy link
Copy Markdown
Contributor Author

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.

@JunTaoLuo

Copy link
Copy Markdown
Contributor Author

cc @Tratcher

_loaded = true;
}
}

Copy link
Copy Markdown
Contributor Author

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.

@Tratcher

Copy link
Copy Markdown
Member

Offline discussion: set a dummy store in the Load failure case so you don't have to check IsAvailable in every method.

@JunTaoLuo JunTaoLuo force-pushed the johluo/unreliable-storage branch from 6fd6560 to ccad490 Compare May 20, 2016 19:25
@JunTaoLuo

Copy link
Copy Markdown
Contributor Author

🆙📅

catch (Exception exception)
{
_logger.SessionCacheReadException(_sessionKey, exception);
return;

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Member

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.

@JunTaoLuo

Copy link
Copy Markdown
Contributor Author

🆙📅

@Tratcher

Copy link
Copy Markdown
Member

:shipit:

@JunTaoLuo JunTaoLuo closed this May 23, 2016
@JunTaoLuo JunTaoLuo force-pushed the johluo/unreliable-storage branch from 7eaea2b to d61c510 Compare May 23, 2016 17:38
@JunTaoLuo JunTaoLuo deleted the johluo/unreliable-storage branch May 23, 2016 17:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants