Skip to content

[Storage] [STG105] Create Session - #5274

Draft
vincenttran-msft wants to merge 3 commits into
Azure:feature/stg_104from
vincenttran-msft:vincenttran/stg105_create_session
Draft

vincenttran-msft wants to merge 3 commits into
Azure:feature/stg_104from
vincenttran-msft:vincenttran/stg105_create_session

Conversation

@vincenttran-msft

@vincenttran-msft vincenttran-msft commented Sep 9, 2026

Copy link
Copy Markdown
Member

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
3 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label Sep 9, 2026
Comment thread sdk/storage/azure_storage_blob/src/clients/append_blob_client.rs Outdated
endpoint: blob_url,
version: options.version,
pipeline,
session_options: options.session_options,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As discussed, I don't think we need to persist this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sounds good. For now I regenerated temporarily off of https://github.com/Azure/azure-rest-api-specs/tree/vincenttran/create_session_swap and for the lowest impact change right now, just added a separate new_with_session() to keep the feature working while not persisting the SessionOptions.

If we want to go down the route of handwriting the options bag, we can do that, but it's abit more mechanical and I want to ensure we want to go down that route before getting the necessary .tsp change in place + handwritten replacement copies of all the options bags.

Comment thread sdk/storage/azure_storage_blob/src/clients/mod.rs Outdated
Comment thread sdk/storage/azure_storage_blob/src/clients/mod.rs Outdated
apply_client_defaults(client_options);
let default_session_options = SessionOptions::default();
let session_options = session_options.unwrap_or(&default_session_options);
let per_retry_policies = build_auth_policies(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you pass just options in, you could pass just options here.

@vincenttran-msft vincenttran-msft Sep 11, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This one was abit confusing and a super subtle difference, so here is the full example:

What happens now (correct):

  • build_pipeline runs with_client_defaults(). transport is None, so it constructs T1. The parent pipeline gets T1.
  • build_auth_policies receives &client_options, which already holds T1.
  • In the implicit-provider branch it does client_options.clone() - so the copy is still T1. (L188 of mod.rs)
  • That goes into BlobServiceClient::new(), which re-enters build_pipeline -> with_client_defaults (L33 of blob_service_client.rs). This time transport.is_none() is false (L79 of mod.rs), so it's left alone. The provider's pipeline also runs on T1.
  • One HTTP client, shared by the data-plane pipeline and the session-minting client.

What would happen with raw options:

  • build_pipeline still makes T1 for the parent pipeline.
  • build_auth_policies gets the raw options, where transport is still None, and clones that into BlobServiceClientOptions.
  • BlobServiceClient::new -> build_pipeline -> with_client_defaults -> transport.is_none() is now true -> constructs T2.

Now if we really wanted to, we could take the generated options as mut and then set the transport so then that transport.is_none() check wouldn't cause the second transport (T2) to be spun up, but want to see your take since a previous comment pushed back on why client_options was mutable, so it feels abit like we are just pushing the &mut up one layer.

Comment thread sdk/storage/azure_storage_blob/src/clients/mod.rs
Comment thread sdk/storage/azure_storage_blob/src/clients/mod.rs Outdated
Comment thread sdk/storage/azure_storage_blob/src/clients/mod.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants