Microsoft.Azure.Documents.InvalidPartitionException thrown, but the type is inaccessible to catch
Opened this issue · 4 comments
This exception was thrown many times:
Exception: Microsoft.Azure.Documents.InvalidPartitionException: Partition range id 6 does not exist, please retry shortly after re-initializing BulkExecutor instance, documentdb-dotnet-sdk/2.0.0 Host/64-bit MicrosoftWindowsNT/6.2.9200.0
However, I cannot catch 'Microsoft.Azure.Documents.InvalidPartitionException' and then re-initialize the client, because the type Microsoft.Azure.Documents.InvalidPartitionException is inaccessible to my code / internal to the library.
100% of writes from all our VMs failed for about an hour continuously after the issue started, and an InvalidPartitionException exception was continuously logged during that time. Once we rebooted the roles (re-initializing the clients), the issue resolved.
Also, caught a post on stackoverflow re: same exception https://stackoverflow.com/questions/50830882/bulkexecotor-threw-microsoft-azure-documents-invalidpartitionexception
A workaround for this is to look at the type name of the exception:
catch (Exception exception) when (exception.GetType().Name == "InvalidPartitionException")
This project is only a sample, not the actual SDK, so it might be better to post this issue on the CosmosDb GitHub project: https://github.com/Azure/azure-cosmosdb-dotnet/issues
This should be fixed by 1.2.0 version of the BulkExecutor library.
Reviving this thread, has this been fixed in 1.2.0 @rnagpal?