Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting request timeout to 10 minutes instead of inf #1295

Merged
merged 3 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- Added `SupportsNamespaces` interface in `neptune.typing` for proper type annotations of Handler and Neptune objects ([#1280](https://github.com/neptune-ai/neptune-client/pull/1280))
- `Run`, `Model`, `ModelVersion` and `Project` could be created with constructor in addition to `init_*` functions ([#1246](https://github.com/neptune-ai/neptune-client/pull/1246))

### Fixes
- Setting request timeout to 10 minutes instead of infinite ([#1295](https://github.com/neptune-ai/neptune-client/pull/1295))

## neptune 1.0.2

### Fixes
Expand Down
3 changes: 3 additions & 0 deletions src/neptune/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"NEPTUNE_SYNC_BATCH_TIMEOUT_ENV",
"NEPTUNE_SUBPROCESS_KILL_TIMEOUT",
"NEPTUNE_FETCH_TABLE_STEP_SIZE",
"NEPTUNE_REQUEST_TIMEOUT",
]

from neptune.common.envs import (
Expand Down Expand Up @@ -53,4 +54,6 @@

NEPTUNE_FETCH_TABLE_STEP_SIZE = "NEPTUNE_FETCH_TABLE_STEP_SIZE"

NEPTUNE_REQUEST_TIMEOUT = "NEPTUNE_REQUEST_TIMEOUT"

S3_ENDPOINT_URL = "S3_ENDPOINT_URL"
4 changes: 3 additions & 1 deletion src/neptune/internal/backends/hosted_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"create_artifacts_client",
]

import os
import platform
from typing import (
Dict,
Expand All @@ -32,6 +33,7 @@

from neptune.common.backends.utils import with_api_exceptions_handler
from neptune.common.oauth import NeptuneAuthenticator
from neptune.envs import NEPTUNE_REQUEST_TIMEOUT
from neptune.exceptions import NeptuneClientUpgradeRequiredError
from neptune.internal.backends.api_model import ClientConfig
from neptune.internal.backends.swagger_client_wrapper import SwaggerClientWrapper
Expand All @@ -52,7 +54,7 @@
ARTIFACTS_SWAGGER_PATH = "/api/artifacts/swagger.json"

CONNECT_TIMEOUT = 30 # helps detecting internet connection lost
REQUEST_TIMEOUT = None
REQUEST_TIMEOUT = int(os.getenv(NEPTUNE_REQUEST_TIMEOUT, "600"))

DEFAULT_REQUEST_KWARGS = {
"_request_options": {
Expand Down