Unlike Java/JS, firestore's python transactions do not retry on invalid transaction errors

未关闭
#19,063 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@pcbeingused333 已经在做这个了。

开始于 2026年11月13日。

  • #19066 来自 @pcbeingused333 —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
databases

调研方向

Read the Python Firestore transaction retry behavior described in the issue and compare it with the linked Node and Java fixes. An open pull request, #19066, is already linked, so check its scope and status before considering this work. Done means invalid-transaction errors are retried consistently with the expected behavior.

由索引模型根据 Issue 内容生成。

描述

triage me type: bug
Determine this is the right repository
  • I determined this is the correct repository in which to report this bug.
Summary of the issue

Context
We use firestore transactions with some reasonable load. For whatever reason the error rate has been elevated today that doesn't seem to match any change in our traffic or usage.

Expected Behavior:
I'd expect transaction's retry behavior to be consistent across platforms. Instead some platforms retry invalid transaction errors but python does not.

Node: https://github.com/googleapis/nodejs-firestore/pull/1347
Java: https://github.com/googleapis/java-firestore/pull/447

Actual Behavior:
Python firestore transactions seem not to retry this error message

API client name and version

google-cloud-firestore 2.34.1

Reproduction steps: code

No response

Reproduction steps: supporting files

No response

Reproduction steps: actual results
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
	status = StatusCode.INVALID_ARGUMENT
	details = "The referenced transaction has expired or is no longer valid."
	debug_error_string = "INVALID_ARGUMENT:The referenced transaction has expired or is no longer valid."
>
(2 additional frame(s) were not displayed)
...
  File "grpc/_interceptor.py", line 331, in _with_call
    return call.result(), call
  File "grpc/_channel.py", line 447, in result
    raise self
  File "grpc/_interceptor.py", line 314, in continuation
    response, call = self._thunk(new_method).with_call(
  File "grpc/_channel.py", line 1182, in with_call
    return _end_unary_response_blocking(state, call, True, None)
  File "grpc/_channel.py", line 999, in _end_unary_response_blocking
    raise _InactiveRpcError(state)  # pytype: disable=not-instantiable

InvalidArgument: The referenced transaction has expired or is no longer valid.
Reproduction steps: expected results

file: output.txtmydata.csv

Calculated: bar
OS & version + platform

Various

Python environment

Python 3.12.14

Python dependencies

No response

Additional context

No response

主要语言
Python
星标
5.4k
派生
1.8k
平均合并
2 天 7 小时
30 天内合并 PR
173

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

googleapis/google-cloud-python 的其他 Issue

查看 googleapis/google-cloud-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。