fixed process_batch function in tutorial 4 #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During tutorial 4, "04-Complex-Docs.ipynb", several issues were observed on the process_batch() function.
Infinite recursion in case of exception: if the exception is thrown constantly due to various reasons, the function will run in an infinite recursive loop, because of the recursive retry (self call) inside the exception catch block => fixed by removing the recursive call and adding a max_retry attempt loop (lines 723, 748)
added batch_id in the function call since the process_batch() signature has changed (line 1242)
requests library does not offer a default timeout for method post(). If for example the Azure Search service is busy/non responsive/unavailable, then the post call will remain locked in a technical hang => fixed by adding a 30 seconds timeout (line 755)
due to issue point 1, some batches can permanently fail, therefore I have added a separate folder for failed_batches and a retry failed batches code block, which is commented with a description and guide on how to use it (line 1264)
noticed there was no description for the process_batch() => added description (line 717)