Align retry safety for mutating connector operations across SDKs
还没有人认领这个 Issue。
评估
调研方向
从 ConnectorHttpClient._send_with_retry 和 ConnectorClientOptions 开始,然后检查现有的 retry 测试,以及生成的客户端所使用的共享 runtime/options 接口。为安全和不安全的方法添加有针对性的覆盖,包括 opt-in 路径,并更新 API 文档和发行说明,以记录默认行为和 opt-in 行为。
由索引模型根据 Issue 内容生成。
描述
Description
Align the Python Connector SDK's retry safety contract with the Node.js SDK behavior introduced in Azure/Connectors-NodeJS-SDK PR #91.
At main commit d273862108d16615009572d730c12950be040a8c, ConnectorHttpClient._send_with_retry retries every HTTP method for 429, every 5xx response, and aiohttp.ClientError. ConnectorClientOptions exposes retry counts and backoff settings but has no method-safety setting. A POST, PUT, PATCH, or DELETE connector action can therefore be submitted again after the service committed it but returned a transient response, or after an ambiguous transport failure.
The cross-language Connector SDK contract should be:
- Retry safe methods (
GET,HEAD,OPTIONS, andTRACE) according to the configured retry policy. - Do not automatically retry unsafe methods (
POST,PUT,PATCH, andDELETE) by default. - Provide an explicit, language-idiomatic per-client opt-in for applying the configured retry policy to unsafe methods, equivalent to Node.js
retryUnsafeHttpMethods. - Preserve the current retry-count, delay, timeout, and exponential-backoff options.
Motivation
Connector operations include side-effecting actions such as sending messages and creating meetings, chats, channels, or files. Automatically replaying a completed action can duplicate customer-visible effects. This risk and the desired explicit opt-in are protocol-level concerns, not Node.js-specific behavior.
Consistent defaults across the .NET, Python, and Node.js Connector SDKs make client behavior predictable when customers move the same connector integration between languages.
Acceptance criteria
- Add a
ConnectorClientOptionssetting with Python-idiomatic naming for opting unsafe HTTP methods into retries. - Safe methods retain the configured retry behavior by default.
- Unsafe methods make one attempt by default for both transient HTTP responses and
aiohttp.ClientErrorfailures. - Unsafe methods use the configured retry behavior when explicitly enabled.
- Add focused tests proving at least:
- a transient GET is retried;
- a transient POST is sent once by default;
- a transient POST is retried when explicitly enabled;
- PUT, PATCH, and DELETE follow the unsafe classification.
- Document the default and opt-in behavior in API documentation and release notes.
- Confirm whether implementation is confined to hand-written runtime/options code. Generated-client regeneration is not expected because generated clients use the shared
ConnectorHttpClientandConnectorClientOptionsruntime surface.
Related work
- Node.js implementation: Azure/Connectors-NodeJS-SDK PR #91
- .NET alignment: Azure/Connectors-NET-SDK issue #269
- 主要语言
- Python
- 星标
- 0
- 派生
- 3
- 平均合并
- 2 天 16 小时
- 30 天内合并 PR
- 10
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Azure/connectors-python-sdk 的其他 Issue
-
难度 5/5 一周以上 新手友好度 30/100
查看 Azure/connectors-python-sdk 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
stephrobert/dsoxlab#238 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
sublimehq/package_control#1780 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 70/100
nwg-piotr/nwg-displays#145 ·