Skip to content

Commit

Permalink
Setting request timeout to 10 minutes instead of inf (#1295)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky committed Mar 14, 2023
1 parent 8dbb5c5 commit 30921a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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

0 comments on commit 30921a6

Please sign in to comment.