SAMZA-2712: AzureBlob SystemProducer: flushtimeout is not respected if main thread is uploading to azure and azure upload is stuck#1564
Merged
rmatharu-zz merged 1 commit intoapache:masterfrom Dec 6, 2021
Conversation
…f main thread is uploading to azure and azure upload is stuck
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Symptom: calling flush on the azure blob system producer does not terminate even after the flush timeout duration expires.
Cause: main thread was uploading to azure but the connection was bad and main thread got stuck. so when the flush was called on the system producer there was no response from the main thread even after the flush timeout expired. The expected behavior is for the flush to end either in success or failure once the timeout expires.
Changes: use reactor's .subsrcibeOn with Schedulers.boundedElastic to block on the mono returned by the azure sdk. this lets us impose a timeout on the mono.block and also lets main thread monitor and jump out of the upload if upload takes longer than the flush timeout duration. After this change, irrespective of which thread (incl main) picks up the azure upload task, it will return from the upload after the flush timeout ms duration and will not hang indefinitely.
Tests: unit test added. also tested at production scale and compared to performance w/ and w/o the change and no major deviations in metrics. Note that for the sake of printing the thread name and accurate timestamp during the unit test, the log4j files were updated.
API changes: none
usage/upgrade instructions: none
Backwards compatible: yes