Repository navigation
Added KVIKIO_REMOTE_VERBOSE option - #815
rapids-bot[bot] merged 8 commits into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test 15d8939 |
|
/ok to test 6c1d338 |
|
Ok, this should be ready for review. Maybe the biggest thing to determine: what name should we use? I've gone with Alternatively, we could call this something like |
| setopt(CURLOPT_TIMEOUT, kvikio::defaults::http_timeout()); | ||
|
|
||
| // Enable verbose output if configured in defaults | ||
| if (kvikio::defaults::http_verbose()) { setopt(CURLOPT_VERBOSE, 1L); } |
There was a problem hiding this comment.
So the purpose of having the http_verbose parameter in the defaults class would be to allow runtime parameter change. Because of how CURL handles are managed in KvikIO, the change will only be applied to newly generated handles, unless we also explicitly reconfigure existing handles. I'm wondering if we really need that. Perhaps we could simply use:
CurlHandle::CurlHandle(...) {
...
auto const verbose = getenv_or("KVIKIO_HTTP_VERBOSE", false);
if(verbose) {
setopt(CURLOPT_VERBOSE, 1L);
}
...
}PS: The CURL handles in KvikIO are reused to minimize handle creation overhead. When an object of CurlHandle goes out of scope, it is not cleaned up, but instead handed back to a global singleton LibCurl which tracks a vector of free CURL handles eligible for reuse. So if we want to apply any runtime parameter change to CURL handles, we need to iterate all the free handles in LibCurl.
|
|
||
| This setting can also be accessed using :py:func:`kvikio.defaults.http_verbose` (getter) and :py:func:`kvikio.defaults.set` (setter). | ||
|
|
||
| **Warning** this may show sensitive contents from headers and data. |
There was a problem hiding this comment.
| **Warning** this may show sensitive contents from headers and data. | |
| .. warning:: | |
| This may show sensitive contents from headers and data. |
|
Good to know that the handles are reused. I've updated it with the simpler implementation. You can observe the output with |
kingcrimsontianyu
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Only the doc needs a minor update.
| #### 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. |
There was a problem hiding this comment.
Update suggested: KVIKIO_REMOTE_VERBOSE
|
/merge |
Co-authored-by: Matthew Murray <41342305+Matt711@users.noreply.github.com>
| #### Remote Verbose (KVIKIO_REMOTE_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_REMOTE_VERBOSE` to `true`, `on`, or `yes` (case-insensitive) to enable verbose output. Otherwise, verbose output is disabled by default. |
There was a problem hiding this comment.
How about 1? That is my favorite way to enable things.
There was a problem hiding this comment.

Our HTTP library, libcurl, includes a
CURLOPT_VERBOSEsetting that can be useful for debugging. To help our users debug things, I've added a newKVIKIO_REMOTE_VERBOSEoption that configures this. By default, it's off (no change). If the user setsKVIKIO_REMOTE_VERBOSE=1then information from the HTTP requests and responses will be printed to stderr.