Azure / Azure/azure-powershell

AddHandler / RemoveHandler are not thread-safe

Open
#15,294 0 comments 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

## Description of the new feature

AzureSession.Instance.ClientFactory.AddHandler and AzureSession.Instance.ClientFactory.RemoveHandler are used by service client to add additional handler into HTTP pipeline. But handlers will be shared across services. When service only wants to register dedicated handler and remove it after cmdlet execution, there is thread-safe problem because registered handlers will be shared with other service client. We need a new design to mitigate this problem.

## Proposed implementation details (optional)

Contributor guide

Open the contributing guide

Research direction

Start by tracing AzureSession.Instance.ClientFactory.AddHandler and RemoveHandler and how service clients use the HTTP pipeline. Define a design that prevents handlers registered for one service or cmdlet execution from being shared or modified concurrently by other service clients; done means concurrent client use is thread-safe.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, powershell
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.