[
https://issues.apache.org/jira/browse/CAMEL-27858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen updated CAMEL-27858:
--------------------------------
Description:
Found while improving the option descriptions of camel-azure-storage-blob for
CAMEL-23832 (commit
https://github.com/apache/camel/commit/87cb1d00f3100684280f706391ed79b732999e11,
pull request https://github.com/apache/camel/pull/31145).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. The blobServiceClient endpoint option has no effect
{{BlobEndpoint.doStart}} always replaces blobServiceClient with the component
serviceClient or a client it builds.
Proposed change: use the endpoint value when set, or deprecate it.
h4. 2. The ListBlobOptions header has no effect
{{BlobConfigurationOptionsProxy.getListBlobOptions}} always overwrites details,
prefix and page size of the CamelAzureStorageBlobListBlobOptions header object
(with null when unset), which are all its fields.
Proposed change: override a field only when its own header or option is set.
h4. 3. Page blob size is one range too small
{{BlobOperations.getPageBlobSize}} uses end - start + 1 of the PageBlobRange
header, so createPageBlob (and uploadPageBlob with createPageBlob=true) with
range 512-1023 creates a 512-byte blob and the upload writes past its end.
Proposed change: use end + 1 when creating.
h4. 4. A released lease ID is reused
{{BlobOperations.acquireLeaseIfConfigured}} sets the lease ID on the
BlobRequestConditions header object and keeps it after releasing; when
uploadPageBlob creates the blob first, the upload then sends the released lease
(412).
Proposed change: copy the conditions before setting the lease ID.
h4. 5. leaseBlob fails for a blob that does not exist yet
With uploadBlockBlob, uploadBlockBlobChunked or createPageBlob the lease is
acquired before the write, and Azure answers 404 for a missing blob.
Proposed change: skip the lease for a missing blob, or create it first.
h4. 6. closeStreamAfterWrite=false leaks file handles
BlobStreamAndLength opens a FileInputStream for a File body that is never
closed.
Proposed change: always close streams the component opened itself.
h4. 7. stageBlockBlobList sends one ContentMD5 for every block
With more than one block the MD5 check fails.
Proposed change: compute or omit the MD5 per block.
_Claude Code on behalf of davsclaus_
was:
Found while improving the option descriptions of camel-azure-storage-blob for
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31145).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. The blobServiceClient endpoint option has no effect
{{BlobEndpoint.doStart}} always replaces blobServiceClient with the component
serviceClient or a client it builds.
Proposed change: use the endpoint value when set, or deprecate it.
h4. 2. The ListBlobOptions header has no effect
{{BlobConfigurationOptionsProxy.getListBlobOptions}} always overwrites details,
prefix and page size of the CamelAzureStorageBlobListBlobOptions header object
(with null when unset), which are all its fields.
Proposed change: override a field only when its own header or option is set.
h4. 3. Page blob size is one range too small
{{BlobOperations.getPageBlobSize}} uses end - start + 1 of the PageBlobRange
header, so createPageBlob (and uploadPageBlob with createPageBlob=true) with
range 512-1023 creates a 512-byte blob and the upload writes past its end.
Proposed change: use end + 1 when creating.
h4. 4. A released lease ID is reused
{{BlobOperations.acquireLeaseIfConfigured}} sets the lease ID on the
BlobRequestConditions header object and keeps it after releasing; when
uploadPageBlob creates the blob first, the upload then sends the released lease
(412).
Proposed change: copy the conditions before setting the lease ID.
h4. 5. leaseBlob fails for a blob that does not exist yet
With uploadBlockBlob, uploadBlockBlobChunked or createPageBlob the lease is
acquired before the write, and Azure answers 404 for a missing blob.
Proposed change: skip the lease for a missing blob, or create it first.
h4. 6. closeStreamAfterWrite=false leaks file handles
BlobStreamAndLength opens a FileInputStream for a File body that is never
closed.
Proposed change: always close streams the component opened itself.
h4. 7. stageBlockBlobList sends one ContentMD5 for every block
With more than one block the MD5 check fails.
Proposed change: compute or omit the MD5 per block.
_Claude Code on behalf of davsclaus_
> camel-azure-storage-blob: the blobServiceClient endpoint option and the
> ListBlobOptions header have no effect, page blob size off, lease handling
> fails
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-27858
> URL: https://issues.apache.org/jira/browse/CAMEL-27858
> Project: Camel
> Issue Type: Bug
> Components: camel-azure
> Reporter: Claus Ibsen
> Priority: Minor
> Fix For: 4.25.0
>
>
> Found while improving the option descriptions of camel-azure-storage-blob for
> CAMEL-23832 (commit
> https://github.com/apache/camel/commit/87cb1d00f3100684280f706391ed79b732999e11,
> pull request https://github.com/apache/camel/pull/31145).
> These are separate problems of the component; the descriptions change only
> documents the current behavior.
> h4. 1. The blobServiceClient endpoint option has no effect
> {{BlobEndpoint.doStart}} always replaces blobServiceClient with the component
> serviceClient or a client it builds.
> Proposed change: use the endpoint value when set, or deprecate it.
> h4. 2. The ListBlobOptions header has no effect
> {{BlobConfigurationOptionsProxy.getListBlobOptions}} always overwrites
> details, prefix and page size of the CamelAzureStorageBlobListBlobOptions
> header object (with null when unset), which are all its fields.
> Proposed change: override a field only when its own header or option is set.
> h4. 3. Page blob size is one range too small
> {{BlobOperations.getPageBlobSize}} uses end - start + 1 of the PageBlobRange
> header, so createPageBlob (and uploadPageBlob with createPageBlob=true) with
> range 512-1023 creates a 512-byte blob and the upload writes past its end.
> Proposed change: use end + 1 when creating.
> h4. 4. A released lease ID is reused
> {{BlobOperations.acquireLeaseIfConfigured}} sets the lease ID on the
> BlobRequestConditions header object and keeps it after releasing; when
> uploadPageBlob creates the blob first, the upload then sends the released
> lease (412).
> Proposed change: copy the conditions before setting the lease ID.
> h4. 5. leaseBlob fails for a blob that does not exist yet
> With uploadBlockBlob, uploadBlockBlobChunked or createPageBlob the lease is
> acquired before the write, and Azure answers 404 for a missing blob.
> Proposed change: skip the lease for a missing blob, or create it first.
> h4. 6. closeStreamAfterWrite=false leaks file handles
> BlobStreamAndLength opens a FileInputStream for a File body that is never
> closed.
> Proposed change: always close streams the component opened itself.
> h4. 7. stageBlockBlobList sends one ContentMD5 for every block
> With more than one block the MD5 check fails.
> Proposed change: compute or omit the MD5 per block.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)