Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End grpc server span in onComplete instead of close #11170

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Apr 18, 2024

Resolves #10988

javadoc of close follows

  /**
   * Close the call with the provided status. No further sending or receiving will occur. If {@link
   * Status#isOk} is {@code false}, then the call is said to have failed.
   *
   * <p>If no errors or cancellations are known to have occurred, then a {@link Listener#onComplete}
   * notification should be expected, independent of {@code status}. Otherwise {@link
   * Listener#onCancel} has been or will be called.
   *
   * <p>Since {@link Metadata} is not thread-safe, the caller must not access (read or write) {@code
   * trailers} after this point.
   *
   * <p>This method implies the caller completed processing the RPC, but it does not imply the RPC
   * is complete. The call implementation will need additional time to complete the RPC and during
   * this time the client is still able to cancel the request or a network error might cause the
   * RPC to fail. If you wish to know when the call is actually completed/closed, you have to use
   * {@link Listener#onComplete} or {@link Listener#onCancel} instead. This method is not
   * necessarily invoked when Listener.onCancel() is called.
   *
   * @throws IllegalStateException if call is already {@code close}d
   */
  public abstract void close(Status status, Metadata trailers);

@laurit laurit requested a review from a team as a code owner April 18, 2024 12:07
@zeitlinger
Copy link
Member

why is there no change in a test?

@laurit laurit merged commit c92955f into open-telemetry:main Apr 30, 2024
53 checks passed
@laurit laurit deleted the grpc-end-span branch April 30, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[opentelemetry-grpc-1.6 ] grpc span ends earlier than expected
2 participants