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
Search Fancy Batching #15750
Search Fancy Batching #15750
Conversation
Still finishing up the tests, but wanted to get the bulk of it out. |
And to review, I'd suggest files that don't start with "Search", followed by Publisher*, followed by SearchIndexingPublisher, followed by SearchIndexingBufferedSender. |
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.
Some initial comments about parallel primitives. Reviewing the rest.
sdk/search/Azure.Search.Documents/src/Batching/PublisherAction{T}.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/ProducerBarrierSlim.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/InitializationBarrierSlim.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/api/Azure.Search.Documents.netstandard2.0.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/AsyncEventExtensions.cs
Outdated
Show resolved
Hide resolved
// be surfaced | ||
if (joined.Exception?.InnerExceptions?.Count > 1) | ||
{ | ||
throw joined.Exception; |
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.
This will overwrite the stack. Instead, throw it as an inner exception to a new exception to preserve the original stack.
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.
Good point.
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.
Looking at this again, I remembered why I didn't care. This is the AggregateException created and thrown by awaiting a few lines up. I don't mind shifting its callstack down here because all of its InnerExceptions with the user's callstacks are fine.
sdk/search/Azure.Search.Documents/src/Batching/InitializationBarrierSlim.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSenderOptions{T}.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/src/Batching/SearchIndexingBufferedSender{T}.cs
Outdated
Show resolved
Hide resolved
Nice and clean! Me likey. |
/azp run net - search - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
Adds SearchIndexingBufferedSender to index search documents with intelligent batching, automatic flushing, and retries for failed indexing actions. Fixes Azure#11161.
2ea393b
to
830978f
Compare
sdk/search/Azure.Search.Documents/samples/Sample05_IndexingDocuments.md
Outdated
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/tests/Batching/AsyncEventExtensionsTests.cs
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/tests/Batching/AsyncEventExtensionsTests.cs
Show resolved
Hide resolved
sdk/search/Azure.Search.Documents/tests/Batching/BatchingTests.cs
Outdated
Show resolved
Hide resolved
#region Snippet:Azure_Search_Documents_Tests_Samples_Sample05_IndexingDocuments_GenerateCatalog | ||
public IEnumerable<Product> GenerateCatalog(int count = 1000) | ||
{ | ||
// Adapted from https://weblogs.asp.net/dfindley/Microsoft-Product-Name-Generator |
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 feel like we should put this in Azure.Core.TestFramework. 😁
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.
That's a good idea for a future release - a lot of the internal test frameworks I've used had really good random generators for names, addresses, etc., that made it easy to set things like this up out of the box.
Adds SearchIndexingBufferedSender to index search documents with intelligent batching, automatic flushing, and retries for failed indexing actions. Fixes Azure#11161.
Adds SearchIndexingBufferedSender to index search documents with intelligent batching, automatic flushing, and retries for failed indexing actions. Fixes Azure#11161.
Adds SearchIndexingBufferedSender to index search documents with intelligent batching, automatic flushing, and retries for failed indexing actions.
Fixes #11161.