firestore times out when using default DNS resolver
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 28/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
- 领域
- databases, networking
调研方向
首先使用 firebase-admin 6.5.0 和 Python 3.12.2 运行 issue 中的 asyncio Firestore 示例,然后使用 GRPC_DNS_RESOLVER=native 重复运行。调查 c-ares 日志所涉及的默认解析器路径;完成的标准是:无需 workaround,示例不再等待 60 秒或因 DNS 失败。
由索引模型根据 Issue 内容生成。
描述
import asyncio
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore_async
import sys
async def main():
user_id = sys.argv[1]
cred = credentials.Certificate("credentials.json")
firebase_admin.initialize_app(cred)
db = firestore_async.client()
user_ref = db.collection("users").document(user_id)
user = await user_ref.get()
print(user)
if __name__ == "__main__":
asyncio.run(main())
This code, using a firebase service account credential, and a database with a users table, will hang for 60 seconds and will fail with a DNS error, this one:
D0408 14:38:20.114377000 7971737600 grpc_ares_wrapper.cc:723] (c-ares resolver) request:0x60000318e4e0 on_hostbyname_done_locked: C-ares status is not ARES_SUCCESS qtype=AAAA name=firestore.googleapis.com is_balancer=0: DNS query cancelled
D0408 14:38:20.114381000 7971737600 grpc_ares_wrapper.cc:723] (c-ares resolver) request:0x60000318e4e0 on_hostbyname_done_locked: C-ares status is not ARES_SUCCESS qtype=A name=firestore.googleapis.com is_balancer=0: DNS query cancelled
...
D0408 14:38:20.114467000 7971737600 dns_resolver_ares.cc:328] (c-ares resolver) resolver:0x600003f8d4a0 dns resolution failed: UNKNOWN:C-ares status is not ARES_SUCCESS qtype=A name=firestore.googleapis.com is_balancer=0: DNS query cancelled {created_time:"2024-04-08T14:38:20.114389-04:00", children:[UNKNOWN:C-ares status is not ARES_SUCCESS qtype=AAAA name=firestore.googleapis.com is_balancer=0: DNS query cancelled {created_time:"2024-04-08T14:38:20.114379-04:00"}]}
This is with firebase-admin 6.5.0 and python 3.12.2
Workaround
Call the python script with this environment variable:
GRPC_DNS_RESOLVER=native
works around the issue.
- 主要语言
- Python
- 星标
- 1.2k
- 派生
- 359
- 平均合并
- 3 天 9 小时
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/firebase-admin-python 的其他 Issue
-
api: remoteconfig
难度 2/5 1-3 小时 新手友好度 75/100
firebase/firebase-admin-python#957 · 1 条评论 ·
-
api: database type: feature request
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 4/5 3-5 天 新手友好度 45/100
firebase/firebase-admin-python#978 · 1 条评论 ·
-
[FR] Support VERIFY_AND_CHANGE_EMAIL in generate_email_action_link (parity with firebase-admin-node) 未关闭api: auth
firebase/firebase-admin-python#949 · 2 条评论 · 1 个 reaction · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 43/100
firebase/firebase-admin-python#945 · 1 条评论 · 1 个 reaction ·
查看 firebase/firebase-admin-python 的全部 Issue
相似的 Issue
-
essnmx good first issue
难度 1/5 1 小时以内 新手友好度 95/100
-
难度 2/5 1-3 小时 新手友好度 65/100
syfoud/Simulated_Scepter#174 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
Giskard-AI/giskard-oss#2840 · 1 条评论 ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success 未关闭area: repo bug perceived difficulty: 2
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
yeti-platform/yeti#1380 ·