The lease mechanism leads to loss of transferred data
See original GitHub issueThe lease mechanism leads to loss of transferred data
I am working on android application which transfer data to azure storage. I successfully implemented it in Kotlin in following way.
val containerClient: BlobContainerClient = getBlobContainerClient(resourceDirectory)
if (!containerClient.exists()) {
containerClient.create()
}
containerClient.getBlobClient(resourceName).uploadFromFile(resourcePath)
Then I had to implement lease mechanism. I used BlobLeaseClientBuilder to build LeaseClient and to acquire lease. Code below.
val containerClient: BlobContainerClient = getBlobContainerClient(resourceDirectory)
if (!containerClient.exists()) {
containerClient.create()
}
val client: BlobClient = containerClient.getBlobClient(resourceName)
val leaseClient: BlobLeaseClient = BlobLeaseClientBuilder()
.blobClient(client)
// .leaseId(UUID.randomUUID().toString()) - also tested
.buildClient()
val acquiredLeaseId: String = leaseClient.acquireLease(-1)
client.uploadFromFile(
resourcePath, //filePath
null, // parallelTransferOptions
null, // headers
null, // metadata
null, // tier
BlobRequestConditions().apply { leaseId = acquiredLeaseId }, // accessConditions
null // timeout
)
leaseClient.releaseLease()
Uploading data in such way does not work. Only container is created correctly
(containerClient.create()
) and azure seems to drop all request when lease is set
(because of incorrect leaseId
?)
Environment:
- OS: development: Ubunto 18.04, tested on OnePlus 6T with Android 10
- IDE: Android Studio: 3.5.3
- Version of the library: group: ‘com.azure’, name: ‘azure-storage-blob’, version: ‘12.0.1’
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Lease modifications - assets.kpmg
Identifying all lease agreements and extracting lease data. Lessees will now recognise most leases on-balance sheet.
Read more >Leases Navigating the guidance in ASC 842 | Grant Thornton
Lease provisions that require the lessee to reimburse the lessor for a deficiency in residual value due to damage, extraordinary wear ...
Read more >Guidance Material and Best Practices for Aircraft Leases - IATA
The lease agreement will almost always be drafted in such a way that the Lessor shall not be liable for any damages or...
Read more >A Tenant's Practical Guide to Commercial Leases
Some leases provide that the landlord can choose what the rental mechanism is under the lease, so the landlord can choose that the...
Read more >Before You Sign That Lease… - Harvard Business Review
Office space rental is often a big expense for a small company. But it can be unnecessarily ... Beyond this, many landlords create...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I’m sorry for lack of information. I fixed this out and everything works perfectly. Thank you so much for your support!
Thanks for opening this android issue on BlobLeaseClient, @rkowalski4. @rickle-msft and @anuchandy will be able to follow up with you shortly.
/cc @bsiegel as FYI