Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
7 changes: 7 additions & 0 deletions cpp/doxygen/main_page.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ Note that if you're reading a large file that has been split into multiple reads

These settings can also be controlled by `defaults::http_max_attempts()`, `defaults::http_max_attempts_reset()`, `defaults::http_status_codes()`, and `defaults::http_status_codes_reset()`.

#### HTTP Verbose (KVIKIO_HTTP_VERBOSE)
For debugging HTTP requests, you can enable verbose output that shows detailed information about HTTP communication including headers, request/response bodies, connection details, and SSL handshake information.

Set the environment variable `KVIKIO_HTTP_VERBOSE` to `true`, `on`, or `yes` (case-insensitive) to enable verbose output. Otherwise, verbose output is disabled by default.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update suggested: KVIKIO_REMOTE_VERBOSE


**Warning** this may show sensitive contents from headers and data.

## Example

```cpp
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/shim/libcurl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ CurlHandle::CurlHandle(LibCurl::UniqueHandlePtr handle,

// Make requests time out after `value` seconds.
setopt(CURLOPT_TIMEOUT, kvikio::defaults::http_timeout());

// Optionally enable verbose output if it's configured.
auto const verbose = getenv_or("KVIKIO_REMOTE_VERBOSE", false);
if (verbose) { setopt(CURLOPT_VERBOSE, 1L); }
}

CurlHandle::~CurlHandle() noexcept { LibCurl::instance().retain_handle(std::move(_handle)); }
Expand Down
11 changes: 11 additions & 0 deletions docs/source/runtime_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,14 @@ KvikIO will retry a request should any of the HTTP status code in ``KVIKIO_HTTP_
The maximum number of attempts to make before throwing an exception is controlled by ``KVIKIO_HTTP_MAX_ATTEMPTS``. The default value is 3. This setting can also be accessed using :py:func:`kvikio.defaults.http_max_attempts` (getter) and :py:func:`kvikio.defaults.set` (setter).

The maximum duration of each HTTP request is controlled by ``KVIKIO_HTTP_TIMEOUT``. The default value is 60, which is the duration in seconds to allow. This setting can also be accessed using :py:func:`kvikio.defaults.http_timoeout` (getter) and :py:func:`kvikio.defaults.set` (setter).

HTTP Verbose ``KVIKIO_REMOTE_VERBOSE``
------------------------------------
Comment thread
TomAugspurger marked this conversation as resolved.
Outdated

For debugging HTTP requests, you can enable verbose output that shows detailed information about HTTP communication including headers, request/response bodies, connection details, and SSL handshake information.

Set the environment variable ``KVIKIO_REMOTE_VERBOSE`` to ``true``, ``on``, or ``yes`` (case-insensitive) to enable verbose output. Otherwise, verbose output is disabled by default.

.. warning::

This may show sensitive contents from headers and data.
3 changes: 2 additions & 1 deletion python/kvikio/kvikio/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def set(*config) -> ConfigContextManager:
- ``"bounce_buffer_size"``
- ``"http_max_attempts"``
- ``"http_status_codes"``
- ``*http_timeout*``
- ``"http_timeout"``

Returns
-------
Expand Down Expand Up @@ -167,6 +167,7 @@ def get(config_name: str) -> Any:
- ``"bounce_buffer_size"``
- ``"http_max_attempts"``
- ``"http_status_codes"``
- ``"http_timeout"``

Returns
-------
Expand Down
Loading