Skip to content

[opamp-client] Remove CompletableFuture usage#2810

Merged
jaydeluca merged 8 commits intoopen-telemetry:mainfrom
breedx-splk:opamp-remove-completablefuture
May 5, 2026
Merged

[opamp-client] Remove CompletableFuture usage#2810
jaydeluca merged 8 commits intoopen-telemetry:mainfrom
breedx-splk:opamp-remove-completablefuture

Conversation

@breedx-splk
Copy link
Copy Markdown
Contributor

See this comment about the gummy bears upgrade change for context.

The tools were quick to point out that the async ritual and use of CompletableFuture wasn't really that helpful because the caller immediately turned around and called .get(30) or whatever on the future anyway....effectively making it synchronous.

(slopvomited with codex)

Copilot AI review requested due to automatic review settings May 1, 2026 18:31
@breedx-splk breedx-splk requested a review from a team as a code owner May 1, 2026 18:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the now-effectively-synchronous CompletableFuture-based HTTP sending flow in opamp-client and replaces it with a synchronous HttpSender API, aligning the implementation with how callers were already using it (blocking on the future).

Changes:

  • Change HttpSender.send(...) to return Response directly (no CompletableFuture).
  • Update HttpRequestService and OkHttpSender to use a synchronous request/response flow (with a per-call timeout configured in OkHttp).
  • Update tests and bump the animalsniffer gummy-bears signature to 0.14.0.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/request/service/HttpRequestService.java Switch request execution to synchronous HttpSender.send(...) and simplify exception handling.
opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/connectivity/http/OkHttpSender.java Implement synchronous OkHttp call execution with a 30s call timeout.
opamp-client/src/main/java/io/opentelemetry/opamp/client/internal/connectivity/http/HttpSender.java Update sender interface to synchronous return type and add declared checked exceptions.
opamp-client/src/test/java/io/opentelemetry/opamp/client/internal/request/service/HttpRequestServiceTest.java Adapt tests and test sender to the synchronous API and new exception behavior.
buildSrc/src/main/kotlin/otel.animalsniffer-conventions.gradle.kts Update gummy-bears signature version to 0.14.0.

Copy link
Copy Markdown
Contributor

@LikeTheSalad LikeTheSalad left a comment

Choose a reason for hiding this comment

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

Cheers!

@jaydeluca jaydeluca added this pull request to the merge queue May 5, 2026
Merged via the queue into open-telemetry:main with commit 225116e May 5, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants