Set-MgRequestContext: expose RetryUnprocessedMutationsOnly so POST and PATCH aren't resent after a 504
維護者通常 7 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 56/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- csharp, powershell
研究方向
Start by tracing IRequestContext, RequestContext, Set-MgRequestContext, and the RetryHandlerOption construction in GraphHttpClientFactory; check the related Get-MgRequestContext documentation and existing tests. Confirm the target SDK versions and that the resolved Kiota HTTP client library supports the option. Done when the setting can be configured through the request context, defaults to false, and the cmdlet and documentation reflect it.
由索引模型根據 Issue 內容生成。
描述
Is your feature request related to a problem? Please describe the problem.
The Graph PowerShell SDK retries a POST after a 504 Gateway Timeout, which can repeat its side effect. With sendMail, one Invoke-MgGraphRequest call can deliver the same email up to four times while the caller sees one error. The reproduction and investigation are in microsoft/kiota-dotnet#851.
Kiota has since added an opt-in setting for this, RetryHandlerOption.RetryUnprocessedMutationsOnly (microsoft/kiota-dotnet#864, merged and expected in kiota-dotnet 2.2.0). When it's on, POST and PATCH are retried only after a 429 or 503, and other responses, including a 504, go back to the caller. It defaults to off.
PowerShell users can't turn it on yet, because Set-MgRequestContext only exposes MaxRetry, RetryDelay, RetriesTimeLimit and ClientTimeout. The only workaround today is Set-MgRequestContext -MaxRetry 0 around each send. That setting is process-wide, so while a send is in flight it also turns off retries for every other Graph request in the process, and two overlapping sends in different runspaces can undo each other's setting.
Describe the solution you'd like.
Expose the setting through the request context:
- add
bool RetryUnprocessedMutationsOnlytoIRequestContext, defaulting tofalseinRequestContext - add a
-RetryUnprocessedMutationsOnlyswitch toSet-MgRequestContext, following the existingBoundParameterspattern - pass it into the
RetryHandlerOptionthatGraphHttpClientFactoryalready builds from the request context - update the
Set-MgRequestContextandGet-MgRequestContextdocs
Set-MgRequestContext -RetryUnprocessedMutationsOnly
Additional context?
This needs Microsoft.Kiota.Http.HttpClientLibrary 2.2.0 or later, which the Authentication module currently gets through Microsoft.Graph.Core.
Open questions:
- Should this target V2, V3 (#3874), or both?
- Is a direct reference to Kiota 2.2.0 acceptable, or should this wait for a
Microsoft.Graph.Corerelease that requires it?
I'm happy to open the PR once 2.2.0 ships.
- 主要語言
- C#
- 星號
- 911
- 分支
- 236
- 平均合併
- 9 天 18 小時
- 30 天內合併 PR
- 33
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoftgraph/msgraph-sdk-powershell 的其他 Issue
-
DirectoryObjects: drop the publicKeyInfrastructureRoot tag from the module mapping (v2)可能已有人在做 @gavinbarron 於 8 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 84/100
microsoftgraph/msgraph-sdk-powershell#3752 · 1 個 reaction · 已指派 2 人 ·
維護者通常 7 天內回覆
-
status:waiting-for-triage type:bug
難度 3/5 1-2 天 新手友好度 54/100
microsoftgraph/msgraph-sdk-powershell#3918 ·
維護者通常 7 天內回覆
-
Status: Needs Investigation type:investigation
難度 5/5 一週以上 新手友好度 18/100
microsoftgraph/msgraph-sdk-powershell#3913 ·
維護者通常 7 天內回覆
-
[v3 wrappers] Support arbitrary optional query parameters可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉status:waiting-for-triage type:feature
難度 5/5 一週以上 新手友好度 35/100
microsoftgraph/msgraph-sdk-powershell#3897 ·
維護者通常 7 天內回覆
-
Tracking for V3 Upgrade可能已有人在做 @ramsessanchez 於 22 天前認領。 未關閉type:epic
microsoftgraph/msgraph-sdk-powershell#3874 · 已指派 1 人 ·
維護者通常 7 天內回覆
查看 microsoftgraph/msgraph-sdk-powershell 的全部 Issue
相似的 Issue
-
🐛 bug 🕒 low effort good first issue
難度 2/5 1-3 小時 新手友好度 85/100
guibranco/Sankhya-SDK-dotnet#654 ·
維護者通常 1 天內回覆
-
a-corriger bug
難度 2/5 1-3 小時 新手友好度 86/100
christian-raj/S-Aloha#340 ·
-
遇到超大文件会卡住未關閉
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 4 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/microsoft-ui-reactor#1626 ·
維護者通常 1 天內回覆
-
Triage:Untriaged Type:Bug
難度 2/5 1-3 小時 新手友好度 79/100