armeria icon indicating copy to clipboard operation
armeria copied to clipboard

Fixed `AsyncServerInterceptor` to be compatible with OpenTelmetry

Open ikhoon opened this issue 1 year ago • 1 comments

Motivation:

There was a bug in AsyncServerInterceptor where a ForwardingServerCall was not unwrapped properly via reflection. Because of that, OpenTelemetry's TracingServerCall that wraps the existing ServerCall using ForwardingServerCall was rejected by the following condition. https://github.com/line/armeria/blob/6dd5cd18dcdc32431316f272128287b2037249d3/grpc/src/main/java/com/linecorp/armeria/server/grpc/DeferredListener.java#L51-L52

Modifications:

  • Use the correct reflection API to unsafely access ForwardingServerCall.delegate().

Result:

  • Fix a bug where AsyncServerInterceptor is incompatible with the OpenTelemetry gRPC agent.
  • Closes #5937

ikhoon avatar Oct 14 '24 14:10 ikhoon

🔍 Build Scan® (commit: 65db0acc9ea52e8703245d7fc0d51bd2aa611402)

Job name Status Build Scan®
build-ubicloud-standard-8-jdk-8 https://ge.armeria.dev/s/mkmsxs2v4w5yq
build-ubicloud-standard-8-jdk-21-snapshot-blockhound https://ge.armeria.dev/s/qgvxhbmgyoi7q
build-ubicloud-standard-8-jdk-17-min-java-17-coverage https://ge.armeria.dev/s/poygs23dspzc6
build-ubicloud-standard-8-jdk-17-min-java-11 https://ge.armeria.dev/s/flggfpwtobclg
build-ubicloud-standard-8-jdk-17-leak https://ge.armeria.dev/s/efzpnx5bcredy
build-ubicloud-standard-8-jdk-11 https://ge.armeria.dev/s/yl7r2dlttbnpy
build-macos-12-jdk-21 https://ge.armeria.dev/s/k2cjeqj7oj47w

github-actions[bot] avatar Oct 14 '24 15:10 github-actions[bot]