Problem
Three requests.* call sites in dagster-dg-cli omit the timeout= kwarg. Because requests defaults to None (wait forever), a slow/unreachable endpoint hangs the CLI indefinitely.
Affected commands:
dg integrations docs — hangs if dagster-marketplace.vercel.app is slow or unreachable.
dg plus saml upload-identity-provider-metadata — hangs if organization_url is misconfigured or Plus is unavailable.
dg plus saml remove-identity-provider-metadata — same as above.
Affected call sites (master @ 911a238e94)
| File |
Line |
Call |
python_modules/libraries/dagster-dg-cli/dagster_dg_cli/cli/utils.py |
582 |
requests.get(<marketplace URL>) |
python_modules/libraries/dagster-dg-cli/dagster_dg_cli/cli/api/organization.py |
139 |
requests.post(url=..., headers=..., files=...) |
python_modules/libraries/dagster-dg-cli/dagster_dg_cli/cli/api/organization.py |
199 |
requests.post(url=..., headers=...) |
Reproduction (AST scan)
import ast, pathlib
root = pathlib.Path("python_modules/libraries/dagster-dg-cli")
for p in root.rglob("*.py"):
if "_tests/" in str(p) or "/tests/" in str(p):
continue
tree = ast.parse(p.read_text())
for n in ast.walk(tree):
if (isinstance(n, ast.Call)
and isinstance(n.func, ast.Attribute)
and n.func.attr in {"get","post","put","delete","patch","head","request"}
and getattr(n.func.value, "id", None) == "requests"
and "timeout" not in {k.arg for k in n.keywords if k.arg}):
print(f"{p.relative_to(root)}:{n.lineno} requests.{n.func.attr}() missing timeout=")
Output on current master:
dagster_dg_cli/cli/utils.py:582 requests.get() missing timeout=
dagster_dg_cli/cli/api/organization.py:139 requests.post() missing timeout=
dagster_dg_cli/cli/api/organization.py:199 requests.post() missing timeout=
Suggested fix
Add timeout=(5, 60) (5s connect / 60s read) to each call site. Matches prior direction in #17831 ("Add client timeout for schedules/sensors"). PR to follow.
Problem
Three
requests.*call sites indagster-dg-cliomit thetimeout=kwarg. Becauserequestsdefaults toNone(wait forever), a slow/unreachable endpoint hangs the CLI indefinitely.Affected commands:
dg integrations docs— hangs ifdagster-marketplace.vercel.appis slow or unreachable.dg plus saml upload-identity-provider-metadata— hangs iforganization_urlis misconfigured or Plus is unavailable.dg plus saml remove-identity-provider-metadata— same as above.Affected call sites (master @
911a238e94)python_modules/libraries/dagster-dg-cli/dagster_dg_cli/cli/utils.pyrequests.get(<marketplace URL>)python_modules/libraries/dagster-dg-cli/dagster_dg_cli/cli/api/organization.pyrequests.post(url=..., headers=..., files=...)python_modules/libraries/dagster-dg-cli/dagster_dg_cli/cli/api/organization.pyrequests.post(url=..., headers=...)Reproduction (AST scan)
Output on current master:
Suggested fix
Add
timeout=(5, 60)(5s connect / 60s read) to each call site. Matches prior direction in #17831 ("Add client timeout for schedules/sensors"). PR to follow.