[SQL][CONNECT] SparkConnectClient may drop metadata (auth headers) on retried/reattached RPCs if metadata is a non-list iterable
维护者通常 2 天内回复
评估
调研方向
从 python/pyspark/sql/connect/client/reattach.py 中 SparkConnectClient 的元数据赋值处开始,然后跟踪 _metadata 如何被 ReattachExecute、ReleaseExecute 以及重试的 ExecutePlan RPCs 重用。确认一次性 iterable 对每次调用都保持可用,并且元数据在重试和重新连接期间得到保留。
由索引模型根据 Issue 内容生成。
描述
In python/pyspark/sql/connect/client/reattach.py, SparkConnectClient
stores the gRPC metadata as-is:
self._metadata = metadata
If the caller passes a one-shot iterable (e.g. a generator or an
iterator) rather than a list/tuple, this metadata gets consumed the
first time it's iterated. Since the same self._metadata is reused
across multiple RPCs on the same client (ReattachExecute,
ReleaseExecute, and retries of ExecutePlan), any RPC after the first
would silently send empty metadata, which would drop auth-related
headers (e.g. bearer tokens) on those subsequent calls without any
visible error.
This doesn't currently cause a problem for callers that already pass
a list/tuple for metadata, since those remain safely re-iterable.
But it's a latent correctness/robustness issue: nothing enforces that
metadata is passed as a re-iterable type, and the failure mode
(silently missing headers) is easy to miss in testing.
Proposed fix: convert metadata to a list at assignment time
(self._metadata = list(metadata)), so it is guaranteed to be
re-iterable across all RPCs regardless of what type of iterable is
passed in.
This is not an authentication bypass in itself; no existing caller
is currently affected, but it removes a class of accidental-metadata-
loss bugs that could otherwise mask missing auth headers on retry/
reattach paths.
- 主要语言
- Scala
- 星标
- 44.3k
- 派生
- 29.5k
- 平均合并
- 8 小时 43 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/spark 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 2 天内回复
-
[CORE] bug report: collision of resource profile id可能已有人在做 @ybapat 于 88 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 2 天内回复
-
Merge spark PR script hard blocks on JIRA可能已有人在做 @holdenk 于 2 天前认领。 未关闭
apache/spark#59693 · 已指派 1 人 ·
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
requires-triage
难度 2/5 1-3 小时 新手友好度 82/100
apache/datafusion-comet#7176 ·
维护者通常 1 天内回复
-
kind:bug state:needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
OpenLineage/OpenLineage#5100 · 1 条评论 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
testcontainers/testcontainers-scala#623 ·
维护者通常 1 天内回复