Skip to content

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
lakshmi-manasa-g:azure-system-producer-respect-flushtimeout
Dec 6, 2021
Merged

SAMZA-2712: AzureBlob SystemProducer: flushtimeout is not respected if main thread is uploading to azure and azure upload is stuck#1564
rmatharu-zz merged 1 commit intoapache:masterfrom
lakshmi-manasa-g:azure-system-producer-respect-flushtimeout

Conversation

@lakshmi-manasa-g
Copy link
Contributor

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

…f main thread is uploading to azure and azure upload is stuck
Copy link
Contributor

@rmatharu-zz rmatharu-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rmatharu-zz rmatharu-zz merged commit 2e2ed70 into apache:master Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants