Transient Fault Handling Framework for SQL Azure, Windows Azure Storage, Service Bus & Cache
The Transient Fault Handling Framework has been superseded by a newer deliverable from the Patterns & Practices team. It is now called the Transient Fault Handling Application Block and comes in all 3 flavors:
-
Developer guidance: http://msdn.microsoft.com/en-us/library/hh680934(v=PandP.50).aspx
The new Transient Fault Handling Application Block is now our officially recommended approach to handling transient faults in the applications running on the Windows Azure platform.
Please share any feedback, comments or suggestions for improvements. You can get in touch with us via:
-
Twitter: @mspnp, @gmelnik, @TheCATerminator
-
Discussion forum: http://entlib.codeplex.com/discussions
23 Comments
Leave a Reply
You must be logged in to post a comment.














Pingback: AppFabric CAT | Reliable Retry Aware BCP for SQL Azure
Pingback: Implementing Storage Abstraction Layer to Support Very Large Messages in Windows Azure Queues | AppFabric CAT
Sample code looks solid- please make from it some framework for transient operations.
…and please do not reinvent the wheel with HighResolutionTimer -> same implementation is in System.Diagnostics.Stopwatch class
Feedback taken, thanks. One comment though – the reason why HighResolutionTimer is there is due to Stopwatch being suboptimal for the given use case.
Pingback: Windows Azure and //BUILD/ Posts for 9/12/2011+ - Windows Azure Blog
Pingback: DavidAiken » Implementing Windows Azure Retry Logic
I suggest a small change to the method “public T ExecuteCommand(IDbCommand command, RetryPolicy retryPolicy, CommandBehavior behavior)” on lines 268-272 to add a check if the type parameter is “object”. This is to permit the case of invoking the ExecuteScalar method when you don’t know the return type in advance. Without the added check the resultType.IsAssignableFrom(typeof(IDataReader)) check returns true and the code incorrectly assumes you are trying to invoke the ExecuteReader method.
The changes lines are as follows:
if (resultType.IsAssignableFrom(typeof(IDataReader)) && (resultType != typeof(object)))
{
return (T)command.ExecuteReader(behavior);
}
else if (resultType.IsAssignableFrom(typeof(XmlReader)) && (resultType != typeof(object)))
Hi Bruce,
Thanks for the feedback, makes total sense.
The change will be made and the updated package will be published in the upcoming days.
Pingback: Windows Azure Best Practices - Nuno Filipe Godinho
Pingback: Windows Azure Best Practices (PT/EN) - Nuno Filipe Godinho
The current NuGet package references the Microsoft.ServiceBus version 1.0.0.0. The current SDK version is 1.5.0.0… I get compiler warnings because of this.
Are you guys planning on upgrading the package?
Hi Tom!
I have just uploaded a new NuGet package with the support for the latest SDK for Service Bus.
Hi
I’m doing a proof-of-concept project to see if we should use the framework in our product, but I get the following error:
Assembly generation failed — Referenced assembly ‘Microsoft.AzureCAT.Samples.TransientFaultHandling’ does not have a strong name
Could you sign it?
P.S.: I use the version from NuGet.
Will do.
it sounds great, are you going to produce the similar for ODBC driver? as our application is using ODBC to talk to SQL Azure.
Does Transient Fault Handling application block is smart enough to know what type of exceptions to be retried or developer is responsible for using the retry policies only for those exceptions that are of application’s interest?
ExecuteAction() works great for reads. I am, however, worried about writes to the database. Consider the following pseudo-code:
try
{
OpenConnection;
Begin Transaction;
Update 1;
Update 2;
Commit Transaction;
}
catch
{
Rollback Transaction;
}
The easiest way of making this resilient is by making use of ExecuteAction() on the updates (for example, SqlCommand’s ExecuteNonQueryWithRetry). My only concern is that updates have effects on the data. If the update is calling a long sproc and I get a timeout, what did actually happen? Did my sproc succeed? Did it partially succeed? It will be horrible to retry the update a second time if it was the case. It seems like a more robust pattern would to wrap the entire piece of code in ExecuiteAction() instead. Thoughts?
Charles, Hari, David,
First, please accept my apology for the delayed response. Our team was very busy lately.
Please may I suggest you post your questions on the discussion forum here:
http://entlib.codeplex.com/discussions
This will ensure a timely response. Your questions are very valuable and it would make sense to use a public forum so that other folks can learn from your challenges or suggest potential solutions.
Regards,
Valery
Pingback: Windows Azure and Cloud Computing Posts for 4/28/2012+ - Windows Azure Blog
Pingback: Using The Exponential Back-Off Transient Error Detection Strategy « Alexandre Brisebois
Pingback: 33 Windows Azure Best Practices | Aditi Technologies
Pingback: Defining an HTTP Transient Error Detection Strategy For REST Calls | Alexandre Brisebois
Pingback: 33 Windows Azure Best Practices | Aditi Technologies Blog