I work on a hosted service which has Windows Azure Cache deployed on instances of the web role. The cache is enabled on production but in the compute emulator we disable it since we often experience slowdowns and exceptions with the cache emulator. In particular, in the compute emulator we do not load the caching module in the csdef
and at runtime we detect if cache is enabled by creating the DataCacheFactory
and catching the specific exception thrown when the role indicated in the client library configuration is not found in the csdef
.
This worked correctly until Windows Azure Caching 2.0 -- when we upgraded to Windows Azure Caching 2.1 (and Azure SDK 2.1) the behavior changed:
- we don't have the exception on
DataCacheFactory
constructor; when we try to instantiate the
DataCache
from theDataCacheFactory
the role seems to hang and after 3 minutes it returns with the following exception (the complete text can be found here):Microsoft.ApplicationServer.Caching.DataCacheException was unhandled by user code Message=ErrorCode<ERRCA0017>:SubStatus<ES0006>:There is a temporary failure. Please retry later. (<snip>). Additional Information : The client was trying to communicate with the server: net.tcp://WebRole:24233. InnerException: System.Net.Sockets.SocketException Message=No such host is known
Please not that this is not a duplicate of the following SO questions:
- Cant get Azure Cache to work. “There is a temporary failure. Please retry later.”
- Exception while using Windows Azure Caching : No such host is known
- Azure Caching - Failure after upgrading to SDK 2.1 and caching 2.1
since
- I'm sure that I'm using Azure SDK 2.1 (I've checked in debugging that the library versions were correct);
- my problem arises only when I disable the cache role on purpose.