Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[SQL][CONNECT] SparkConnectClient may drop metadata (auth headers) on retried/reattached RPCs if metadata is a non-list iterable

未关闭 适合新手
#57,785 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@zainmirzaaa 已经在做这个了。

开始于 2026年8月21日。

  • #58210 来自 @zainmirzaaa —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
python, spark
领域
api, backend

调研方向

从 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

环境准备

从这里开始

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

apache/spark 的其他 Issue

查看 apache/spark 的全部 Issue

相似的 Issue

更多 Scala Issue

把新 issue 发到你的邮箱

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