← Back to Pull requests

Remove CurlHandle's unused source_file/source_line parameters #1138

Merged
maxwbuckley merged 7 files (68 lines) on Nov 30, 2026 18:41 UTC
View on GitHub
maxwbuckley maxwbuckley commented on Nov 30, 2026 16:14 UTC
Author

CurlHandle's source_file and source_line constructor parameters haven't been read since #653 moved error reporting to KVIKIO_EXPECT/KVIKIO_FAIL. This removes them and fix_conda_file_path_hack(), which existed only to clean up the __FILE__ string passed as source_file. Following review, it also removes the create_curl_handle() macro: callers now construct CurlHandle directly, and its constructor is explicit.

No behavior change. Split out of #1135 at a reviewer's request; #1135 now keeps the parameters and marks them [[maybe_unused]].

CurlHandle is in a public header, so out-of-tree code that constructs it directly with the old four-argument signature would need updating. The same applies to out-of-tree code that uses create_curl_handle(). All callers within KvikIO are updated.

Testing: every changed file compiles with GCC 14 against current main. The first commit's change, applied to the #1135 branch, passed the curl, URL, TLS, multi-poll and remote-handle tests.

🤖 Generated with Claude Code

Diff: 68 lines (+12 / -56) across 7 files Reviewer: kingcrimsontianyu Review duration: 147m
All Vouch review confidence checks passed
Residual risk 0.05 = Change Risk (0.37) × (1 − Review Confidence (0.87)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 68 lines diff across 7 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.82 · 5 substantive comment(s)
0.82
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
86%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.253
Real PR Conversation Timeline
14 items
copy-pr-bot[bot] copy-pr-bot[bot] commented on Nov 30, 2026 16:14 UTC
Bot

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

maxwbuckley maxwbuckley commented on Nov 30, 2026 16:14 UTC
Author

Could a maintainer add the improvement and non-breaking labels (I can't set labels as an outside contributor) and /ok to test 6e321eb? Thanks!

kingcrimsontianyu kingcrimsontianyu commented on Nov 30, 2026 16:17 UTC
Contributor

/ok to test 6e321eb

copy-pr-bot[bot] copy-pr-bot[bot] commented on Nov 30, 2026 16:18 UTC
Bot

/ok to test 6e321eb

@kingcrimsontianyu, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

kingcrimsontianyu kingcrimsontianyu commented on Nov 30, 2026 16:23 UTC
Contributor

/ok to test 6e321eb351b8b0dd90ffad6d0990cbdda07d7b32

kingcrimsontianyu kingcrimsontianyu commented on code on Nov 30, 2026 16:37 UTC
Code Review
cpp/include/kvikio/shim/libcurl.hpp:1
@@ -272,9 +245,6 @@ void count_http_connection_of(CURL* easy) noexcept;
  *
  * @returns A `kvikio::CurlHandle` instance ready to be used.
  */
-#define create_curl_handle()                                             \
-  kvikio::CurlHandle(kvikio::LibCurl::instance().get_handle(),           \
-                     kvikio::detail::fix_conda_file_path_hack(__FILE__), \
-                     KVIKIO_STRINGIFY(__LINE__))
+#define create_curl_handle() kvikio::CurlHandle(kvikio::LibCurl::instance().get_handle())

I think we can remove this macro and simply use direct initialization at the call site now:

CurlHandle curl(LibCurl::instance().get_handle());

kingcrimsontianyu kingcrimsontianyu commented on code on Nov 30, 2026 16:41 UTC
Code Review
cpp/include/kvikio/shim/libcurl.hpp:1
@@ -95,14 +95,9 @@ class CurlHandle {
    * Typically, do not call this directly instead use the `create_curl_handle()` macro.
    *
    * @param handle An unused curl easy handle pointer, which is retained on destruction.
-   * @param source_file Path of source file of the caller (for error messages).
-   * @param source_line Line of source file of the caller (for error messages).
    * @param use_shared_dns_cache Whether to use shared DNS caches provided by the share handles.
    */
-  CurlHandle(LibCurl::UniqueHandlePtr handle,
-             std::string source_file,
-             std::string source_line,
-             bool use_shared_dns_cache = true);
+  CurlHandle(LibCurl::UniqueHandlePtr handle, bool use_shared_dns_cache = true);

  explicit CurlHandle(LibCurl::UniqueHandlePtr handle, bool use_shared_dns_cache = true);

maxwbuckley maxwbuckley commented on code on Nov 30, 2026 17:12 UTC
Code Review
cpp/include/kvikio/shim/libcurl.hpp:1
@@ -272,9 +245,6 @@ void count_http_connection_of(CURL* easy) noexcept;
  *
  * @returns A `kvikio::CurlHandle` instance ready to be used.
  */
-#define create_curl_handle()                                             \
-  kvikio::CurlHandle(kvikio::LibCurl::instance().get_handle(),           \
-                     kvikio::detail::fix_conda_file_path_hack(__FILE__), \
-                     KVIKIO_STRINGIFY(__LINE__))
+#define create_curl_handle() kvikio::CurlHandle(kvikio::LibCurl::instance().get_handle())

Done in a8a3722: the macro is gone and all 11 call sites (including the tests) construct CurlHandle directly.

maxwbuckley maxwbuckley commented on code on Nov 30, 2026 17:12 UTC
Code Review
cpp/include/kvikio/shim/libcurl.hpp:1
@@ -95,14 +95,9 @@ class CurlHandle {
    * Typically, do not call this directly instead use the `create_curl_handle()` macro.
    *
    * @param handle An unused curl easy handle pointer, which is retained on destruction.
-   * @param source_file Path of source file of the caller (for error messages).
-   * @param source_line Line of source file of the caller (for error messages).
    * @param use_shared_dns_cache Whether to use shared DNS caches provided by the share handles.
    */
-  CurlHandle(LibCurl::UniqueHandlePtr handle,
-             std::string source_file,
-             std::string source_line,
-             bool use_shared_dns_cache = true);
+  CurlHandle(LibCurl::UniqueHandlePtr handle, bool use_shared_dns_cache = true);

Applied in a8a3722.

kingcrimsontianyu kingcrimsontianyu commented on Nov 30, 2026 18:02 UTC
Contributor

/ok to test a8a3722dc2dce4628f0d4aabce1bc04f0ac8d628

kingcrimsontianyu kingcrimsontianyu commented on Nov 30, 2026 18:32 UTC
Contributor

Thanks for the cleanup!

kingcrimsontianyu kingcrimsontianyu commented on Nov 30, 2026 18:32 UTC
Contributor

/merge

kingcrimsontianyu kingcrimsontianyu approved these changes on Nov 30, 2026 18:40 UTC
Approved Reviewer

Approved these changes.

Assignees
maxwbuckley maxwbuckley
Labels
risk: low confidence: 86.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 37.1% (MEDIUM) · Higher = larger blast radius
37.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 86.8% · Lower = rushed or shallow review
86.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 4.9% · Safe to merge
4.9%