-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EventHubs] Partition Manager uses Event Hubs namespace as a key #7637
Conversation
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.
LGTM. A couple of minor thoughts around naming, based on conversations with the service team and internal consistency.
sdk/eventhub/Azure.Messaging.EventHubs.CheckpointStore.Blob/src/BlobPartitionManager.cs
Outdated
Show resolved
Hide resolved
sdk/eventhub/Azure.Messaging.EventHubs.CheckpointStore.Blob/src/BlobPartitionManager.cs
Outdated
Show resolved
Hide resolved
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.
Overall still looks good. Shivangi has some great call-outs around a bit of documentation tweaks that we probably want to include.
@@ -91,6 +93,7 @@ await foreach (var response in ContainerClient.GetBlobsAsync(options).ConfigureA | |||
} | |||
|
|||
ownershipList.Add(new InnerPartitionOwnership( | |||
fullyQualifiedNamespace, |
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 should add a try catch block around the foreach loop because ContainerClient.GetBlobsAsync(options)
can throw an error while fetching the list of blobs.
try {
await foreach (var response in ContainerClient.GetBlobsAsync(options).ConfigureAwait(false))
{
-
-
}
return ownershipList;
} catch(err) {
Log($"Error occurred while fetching the list of blobs: '{ err }'");
throw err;
}
Similarly in updateCheckpoint()
method we should throw the errors in catch blocks if any error occurs while updating the checkpoint for the partition. We shouldn't swallow the errors in this case(I believe we swallow these errors in Event Hubs, so it won't stop any process but we should throw from this library)
I know this is not related to your current PR but something to keep in mind
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.
Just took a note. That's something I definitely should revisit when updating the error handling and implementing the Event Processor logging.
Current implementations of
InMemoryPartitionManager
andBlobPartitionManager
have three keys (all of them strings) to access content:These changes include a fourth key, Fully Qualified Namespace (also a string), to avoid ambiguity when a single Partition Manager is being used by Event Processors in different namespace contexts.
The main changes include:
PartitionOwnership
class to include a namespace property.Checkpoint
class to include a namespace property.PartitionContext
class to include a namespace property.PartitionManager
and its derived classes to make use of the new key when managing ownership.PartitionOwnership.IsEquivalentTo
extension method to take the new key into consideration when checking equivalence.InMemoryPartitionManager
, 2 forBlobPartitionManager
).