Set-MgRequestContext: expose RetryUnprocessedMutationsOnly so POST and PATCH aren't resent after a 504
I maintainer di solito rispondono entro 7 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- csharp, powershell
- Ambito
- backend-api-design
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- C#
- Stelle
- 911
- Fork
- 236
- Merge medio
- 9g 18h
- PR unite (30g)
- 33
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoftgraph/msgraph-sdk-powershell
-
DirectoryObjects: drop the publicKeyInfrastructureRoot tag from the module mapping (v2)Forse già presa @gavinbarron l’ha presa 8 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
microsoftgraph/msgraph-sdk-powershell#3752 · 1 reazione · 2 assegnatari ·
I maintainer di solito rispondono entro 7 giorni
-
status:waiting-for-triage type:bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 54/100
microsoftgraph/msgraph-sdk-powershell#3918 ·
I maintainer di solito rispondono entro 7 giorni
-
Status: Needs Investigation type:investigation
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
microsoftgraph/msgraph-sdk-powershell#3913 ·
I maintainer di solito rispondono entro 7 giorni
-
[v3 wrappers] Support arbitrary optional query parametersForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertastatus:waiting-for-triage type:feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
microsoftgraph/msgraph-sdk-powershell#3897 ·
I maintainer di solito rispondono entro 7 giorni
-
Tracking for V3 UpgradeForse già presa @ramsessanchez l’ha presa 22 giorni fa. Apertatype:epic
microsoftgraph/msgraph-sdk-powershell#3874 · 1 assegnatario ·
I maintainer di solito rispondono entro 7 giorni
Tutte le issue di microsoftgraph/msgraph-sdk-powershell
Issue simili
-
🐛 bug 🕒 low effort good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
guibranco/Sankhya-SDK-dotnet#654 ·
I maintainer di solito rispondono entro 1 giorno
-
a-corriger bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
christian-raj/S-Aloha#340 ·
-
遇到超大文件会卡住Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 4 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/microsoft-ui-reactor#1626 ·
I maintainer di solito rispondono entro 1 giorno
-
Triage:Untriaged Type:Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100