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.
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
Updating stats jobs to use new Azure SDK #10323
base: dev
Are you sure you want to change the base?
Updating stats jobs to use new Azure SDK #10323
Changes from all commits
16f1755
9155726
fabc79f
f8c5829
4a4b0f1
b14c3fc
97e310d
3d55f83
b67bd58
cbf5066
bb807d0
03e111c
7693ca6
e9a646c
901b38d
572ca1d
710e178
626d2e6
bb56055
28b8c53
f6b50de
e69fee8
d613266
faca4bf
c87896b
8d3c01d
8e68ca6
76dc679
f5c36ef
a176ce0
477bb5f
629cdce
2403857
505096a
6a13b42
3651f31
47a5092
b778307
84c4699
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 change introduces a potential issue:
AzureBlobLeaseManager
can be constructed with aBlobServiceClient
configured for a certain storage account with a certain container and base path, and thenAcquireLease
can be called passing a blob that might reside in a different storage account, or different container or not use the base path passed intoAzureBlobLeaseManager
constructor.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.
All 3 added arguments (
blobServiceClient
,containerName
,basePath
) seem to exist only to be passed into aBlobLeaseService
constructor. I suggest to changeAzureBlobLeaseManager
constructor to accept aIBlobLeaseService
object instead and update the job setup accordingly.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.
Still, we need to sort out the blob validation. One way of doing that could be to add a
TryAcquireAsync
overload inBlobLeaseService
that would accept a blob URL instead of aresourceName
, validate its values against the object configuration then inferresourceName
from URL and call the original implementation. Then this new method (passing in full blob URL) can be used inAzureBlobLeaseManager.AcquireLease
.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.
is this used outside of stats job world? Can we rename this to AcquireLeaseAsync without breaking anything? If not, ignore this comment.
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.
It isn't, seems like this is the only reference:
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.
nit: Please invert the order. Please check the success first then it's easier to read.
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.
Check the success before what?
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 wonder why we had this check in the original code. Technically, it is checking for a different thing than the
while
loop below, but I think the check inwhile
loop would cover all cases this check would test. Any ideas?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.
Starting a task might be an expensive operation, so it's beneficial to check before entering the task to improve performance.
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.
There is no starting tasks between line 66 and 68. They literally are run one after another.
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.
Do not pass cancellation token into
Task.Delay
. It will throw if cancelled while waiting (unlikeThread.Sleep
in the original code).