Set-MgRequestContext: expose RetryUnprocessedMutationsOnly so POST and PATCH aren't resent after a 504
Maintainer antworten meist innerhalb von 7 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 56/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- csharp, powershell
- Bereich
- backend-api-design
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- C#
- Sterne
- 911
- Forks
- 236
- Ø Merge
- 9 T. 18 Std.
- Gemergte PRs (30 T.)
- 33
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoftgraph/msgraph-sdk-powershell
-
DirectoryObjects: drop the publicKeyInfrastructureRoot tag from the module mapping (v2)Evtl. vergeben @gavinbarron hat das vor 8 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
microsoftgraph/msgraph-sdk-powershell#3752 · 1 Reaktion · 2 zugewiesene Personen ·
Maintainer antworten meist innerhalb von 7 Tagen
-
status:waiting-for-triage type:bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 54/100
microsoftgraph/msgraph-sdk-powershell#3918 ·
Maintainer antworten meist innerhalb von 7 Tagen
-
Status: Needs Investigation type:investigation
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 18/100
microsoftgraph/msgraph-sdk-powershell#3913 ·
Maintainer antworten meist innerhalb von 7 Tagen
-
[v3 wrappers] Support arbitrary optional query parametersEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenstatus:waiting-for-triage type:feature
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
microsoftgraph/msgraph-sdk-powershell#3897 ·
Maintainer antworten meist innerhalb von 7 Tagen
-
Tracking for V3 UpgradeEvtl. vergeben @ramsessanchez hat das vor 22 Tagen übernommen. Offentype:epic
microsoftgraph/msgraph-sdk-powershell#3874 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 7 Tagen
Alle Issues in microsoftgraph/msgraph-sdk-powershell
Ähnliche Issues
-
🐛 bug 🕒 low effort good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
guibranco/Sankhya-SDK-dotnet#654 ·
Maintainer antworten meist innerhalb von 1 Tag
-
a-corriger bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
christian-raj/S-Aloha#340 ·
-
遇到超大文件会卡住Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 4 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
microsoft/microsoft-ui-reactor#1626 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Triage:Untriaged Type:Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 79/100