sql.connect wrongly reports a timeout when attempting to connect to a non-existing warehouse
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- python
调研方向
从 sql.connect 和 issue 中描述的 ThriftBackend 重试路径开始,然后重现针对不存在的 warehouse_id 的连接尝试。跟踪重复的 404 响应如何变成 MaxRetryError,并确定现有的异常边界。完成标准是:无需解析异常文本,即可区分不存在或已删除的 warehouse 与超时,同时保持正常的重试行为不变。
由索引模型根据 Issue 内容生成。
描述
Disclaimer: I am a Databricks employee.
Calling databricks.sql.connect with a non-existing warehouse_id will raise a generic time-out exception, coming from the ThriftBackend.
It's only by digging in the source code that one can find the default of 30(!) retries - which can be set by including _retry_stop_after_attempts_count in sql.connect.
As a user of SQL Client, I'd like to easily make a distinction between a timeout (=unknown circumstances, makes more sense to retry) and a non-existing/deleted warehouse (=hard fact, makes no sense to keep trying to connect).
connection = sql.connect(
server_hostname=server_hostname,
http_path=f"""/sql/1.0/warehouses/{warehouse_id}""",
credentials_provider=_credentials_provider
)
Exception:
HTTPSConnectionPool(host='[xxxx.databricks.com](http://xxxx.cloud.databricks.com/)', port=443):
Max retries exceeded with url: /sql/1.0/warehouses/786786d78562786
(Caused by ResponseError('too many 404 error responses')).
Alternatives considered
- One can add another dependency to the SDK and check if the Warehouse exists. It seems overkill to add the SDK just for that purpose. It really should be part of the connect client.
- One can parse the exception text and apply some heuristics to form an educated guess with the 404 reply. This is hacky and might have too many edge-cases. E.g. calling
/sql/1.0/**warehoses**/xxxxxwould raise the exact same exception.
- 主要语言
- Python
- 星标
- 233
- 派生
- 152
- 平均合并
- 21 小时 5 分钟
- 30 天内合并 PR
- 10
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
databricks/databricks-sql-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 84/100
查看 databricks/databricks-sql-python 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 84/100
PolicyEngine/policyengine-us#9559 ·
-
priority: p3
难度 2/5 1-3 小时 新手友好度 72/100
googleapis/librarian#7636 ·
-
from:qa priority:P2 reliability tech-debt
难度 2/5 1-3 小时 新手友好度 78/100
spec-kitty/spec-kitty#4874 ·
-
难度 2/5 1-3 小时 新手友好度 68/100