Skip to content

merge v5.13.5 release #1499

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

Merged
merged 20 commits into from
Jul 22, 2025
Merged

merge v5.13.5 release #1499

merged 20 commits into from
Jul 22, 2025

Conversation

EvenLjj
Copy link
Collaborator

@EvenLjj EvenLjj commented Jul 22, 2025

cherry pick v5.13.4 & v5.13.5

Summary by CodeRabbit

  • New Features

    • Enhanced tracing and metrics for streaming RPC calls, including detailed event logging for client and server message send/receive operations.
    • Added new configuration options and constants for improved event tagging and streaming event tracking.
    • Introduced JSON-based event log encoders and new event log types for richer trace reporting.
    • Added new test cases for streaming and unary RPC scenarios.
  • Bug Fixes

    • Corrected test configuration and provider export logic in integration tests.
  • Refactor

    • Simplified service registration logic and improved context management for server and client interceptors.
  • Chores

    • Upgraded tracer dependency version for improved stability and features.

liujianjun.ljj and others added 20 commits January 17, 2025 15:37
* support stream event log

* support stream event log

* support stream event log

* support stream event log

---------

Co-authored-by: liujianjun.ljj <[email protected]>
Co-authored-by: liujianjun.ljj <[email protected]>
…elease_merge

# Conflicts:
#	all/pom.xml
#	bom/pom.xml
#	core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java
#	core/api/src/main/java/com/alipay/sofa/rpc/common/Version.java
#	pom.xml
#	remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ClientHeaderClientInterceptor.java
#	remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java
#	remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/server/triple/TripleServer.java
Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

Walkthrough

This update introduces enhanced tracing and event logging for streaming RPCs. It adds new event constants, span event encoders, and event reporters to the tracing subsystem, expands client and server interceptors for detailed span event creation, and updates test configurations. The service registration logic is simplified, and dependency versions are updated.

Changes

Files/Paths Change Summary
all/pom.xml, bom/pom.xml Updated tracer dependency version from 3.1.6 to 3.1.10.
core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java Added streaming event constants and a new internal key for first stream response timing.
core/api/src/main/java/com/alipay/sofa/rpc/context/RpcInvokeContext.java Added resetContext static method for optimized context management.
core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AbstractCluster.java Added timing measurement for obtaining client transport in sendMsg.
remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ClientHeaderClientInterceptor.java Enhanced tracing: added detailed span event creation for streaming send/receive, improved context handling.
remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java Refactored for detailed tracing, event creation, and improved context and error management for streaming.
remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/server/triple/TripleServer.java Simplified service registration logic: keyed by interface ID, removed explicit invoker count tracking.
remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java Set invocation type on SofaRequest based on gRPC method type in tracing logic.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/RpcSofaTracer.java Added event-based reporters and encoders, included streaming first response timing in trace records.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/factory/ReporterFactory.java Added factory method for event reporters; made report type constant final.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java Introduced abstract class for JSON event encoding of tracing spans.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcClientEventJsonEncoder.java Added client-side JSON encoder for tracing span events.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcServerEventJsonEncoder.java Added server-side JSON encoder for tracing span events.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/RpcEventTags.java Added constants for standardized RPC event tag names.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/TracerRecord.java Added R0 enum for streaming first response latency.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/type/RpcTracerLogEnum.java Added RPC_CLIENT_EVENT and RPC_SERVER_EVENT enum constants for new log types.
test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleGenericStreamTest.java Set explicit application configs and timeouts in test setup.
test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleStubStreamTest.java Set application configs, updated URLs, and added a unary request test method.
test/test-integration/src/test/java/com/alipay/sofa/rpc/triple/ark/MultiClassLoaderTest.java Fixed provider export to correct instance in test.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ClientInterceptor
    participant Tracer
    participant ServerInterceptor
    participant Server

    Client->>ClientInterceptor: sendMessage(request)
    ClientInterceptor->>Tracer: record CLIENT_SEND_EVENT (size, seqId, etc.)
    ClientInterceptor->>Server: send(request)
    Server->>ServerInterceptor: onMessage(request)
    ServerInterceptor->>Tracer: record SERVER_RECEIVE_EVENT (size, seqId, etc.)
    ServerInterceptor->>Server: process(request)
    Server->>ServerInterceptor: sendMessage(response)
    ServerInterceptor->>Tracer: record SERVER_SEND_EVENT (size, seqId, etc.)
    ServerInterceptor->>Client: send(response)
    Client->>ClientInterceptor: onMessage(response)
    ClientInterceptor->>Tracer: record CLIENT_RECEIVE_EVENT (size, seqId, etc.)
Loading

Estimated code review effort

4 (~90 minutes)

Possibly related PRs

Suggested labels

cla:yes, size/XL

Suggested reviewers

  • chuailiwu
  • Lo1nt

Poem

In the meadow of code, where the streams now flow,
A rabbit hops, tracing every send and echo.
With new events and tags, our logs brightly gleam,
Streaming first responses—now part of the dream!
Hooray for the tracers, with carrots in tow,
🥕✨ Our RPC garden continues to grow!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@EvenLjj EvenLjj changed the title V5.13.5 release merge merge v5.13.5 release Jul 22, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleGenericStreamTest.java (1)

74-80: Configuration improvements with excessive timeout concern.

The explicit ApplicationConfig and appName query parameter are good additions that support the enhanced tracing features. However, the timeout of 1,000,000ms (~16.7 minutes) seems excessive for integration tests.

Consider reducing the timeout to a more reasonable value (e.g., 30000ms) unless this extreme timeout is specifically needed for the streaming scenarios being tested.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ClientHeaderClientInterceptor.java (1)

243-243: Consider adding message size validation.

While the size calculation is correct, consider adding validation for extremely large messages that might indicate serialization issues or potential DoS attacks.

You could add a check for message size limits to prevent potential issues:

 if (message instanceof GeneratedMessageV3) {
     messageSize = ((GeneratedMessageV3) message).getSerializedSize();
+    // Consider adding size validation
+    if (messageSize > MAX_MESSAGE_SIZE_THRESHOLD) {
+        LOGGER.warn("Large message size detected: {} bytes", messageSize);
+    }
     Object reqSize = internalContext.getAttachment(RpcConstants.INTERNAL_KEY_REQ_SIZE);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d1375ba and 411c35f.

📒 Files selected for processing (20)
  • all/pom.xml (1 hunks)
  • bom/pom.xml (1 hunks)
  • core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AbstractCluster.java (1 hunks)
  • core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java (2 hunks)
  • core/api/src/main/java/com/alipay/sofa/rpc/context/RpcInvokeContext.java (1 hunks)
  • remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ClientHeaderClientInterceptor.java (7 hunks)
  • remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java (3 hunks)
  • remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/server/triple/TripleServer.java (3 hunks)
  • remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java (1 hunks)
  • test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleGenericStreamTest.java (2 hunks)
  • test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleStubStreamTest.java (3 hunks)
  • test/test-integration/src/test/java/com/alipay/sofa/rpc/triple/ark/MultiClassLoaderTest.java (1 hunks)
  • tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/RpcSofaTracer.java (5 hunks)
  • tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/factory/ReporterFactory.java (3 hunks)
  • tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java (1 hunks)
  • tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcClientEventJsonEncoder.java (1 hunks)
  • tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcServerEventJsonEncoder.java (1 hunks)
  • tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/RpcEventTags.java (1 hunks)
  • tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/TracerRecord.java (2 hunks)
  • tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/type/RpcTracerLogEnum.java (1 hunks)
🧠 Learnings (14)
📓 Common learnings
Learnt from: EvenLjj
PR: sofastack/sofa-rpc#1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.
Learnt from: EvenLjj
PR: sofastack/sofa-rpc#1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/type/RpcTracerLogEnum.java (1)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleGenericStreamTest.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcServerEventJsonEncoder.java (1)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleStubStreamTest.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcClientEventJsonEncoder.java (1)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/factory/ReporterFactory.java (1)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java (1)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/server/triple/TripleServer.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ClientHeaderClientInterceptor.java (3)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/RpcSofaTracer.java (2)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java (3)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

🧬 Code Graph Analysis (6)
remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java (1)
core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java (1)
  • RpcConstants (28-747)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcServerEventJsonEncoder.java (1)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/RpcSpanTags.java (1)
  • RpcSpanTags (24-192)
test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleStubStreamTest.java (1)
core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java (1)
  • RpcConstants (28-747)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcClientEventJsonEncoder.java (1)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/RpcSpanTags.java (1)
  • RpcSpanTags (24-192)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/factory/ReporterFactory.java (1)
core/common/src/main/java/com/alipay/sofa/rpc/common/config/RpcConfigKeys.java (1)
  • RpcConfigKeys (28-155)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java (2)
core/common/src/main/java/com/alipay/sofa/rpc/common/utils/CommonUtils.java (1)
  • CommonUtils (30-278)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/RpcSpanTags.java (1)
  • RpcSpanTags (24-192)
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
Learnt from: EvenLjj
PR: sofastack/sofa-rpc#1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.
Learnt from: EvenLjj
PR: sofastack/sofa-rpc#1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/type/RpcTracerLogEnum.java (1)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleGenericStreamTest.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcServerEventJsonEncoder.java (1)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleStubStreamTest.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcClientEventJsonEncoder.java (1)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/factory/ReporterFactory.java (1)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java (1)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/server/triple/TripleServer.java (2)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ClientHeaderClientInterceptor.java (3)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/RpcSofaTracer.java (2)

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java (3)

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java:290-303
Timestamp: 2025-05-08T06:34:38.670Z
Learning: In SOFA-RPC's Triple protocol adapter, the server detects invocation type (streaming/sync) from gRPC method descriptors but intentionally doesn't propagate this to request properties or headers. This is by design to maintain compatibility with clients of different versions, as the server should rely on client-provided values rather than overriding them.

Learnt from: EvenLjj
PR: #1488
File: remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java:105-120
Timestamp: 2025-05-08T06:59:23.963Z
Learning: In SOFA RPC, TripleTracerAdapter.serverReceived() sets the invocation type on the SofaRequest based on the gRPC method type (CLIENT_STREAMING, SERVER_STREAMING, BIDI_STREAMING), but the SofaRequest.isAsync() method does not directly recognize these streaming types as asynchronous. According to EvenLjj, some modification in TripleTracerAdapter.serverReceived makes sofaRequest.isAsync() return true for streaming requests.

Learnt from: EvenLjj
PR: #1488
File: tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java:34-36
Timestamp: 2025-05-08T06:50:45.709Z
Learning: In the SOFA RPC tracer framework, JsonStringBuilder instances in SpanEncoder implementations are provided by the tracer core, which is responsible for solving thread safety/concurrency issues rather than individual encoder implementations.

🧬 Code Graph Analysis (6)
remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java (1)
core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java (1)
  • RpcConstants (28-747)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcServerEventJsonEncoder.java (1)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/RpcSpanTags.java (1)
  • RpcSpanTags (24-192)
test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleStubStreamTest.java (1)
core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java (1)
  • RpcConstants (28-747)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcClientEventJsonEncoder.java (1)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/RpcSpanTags.java (1)
  • RpcSpanTags (24-192)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/factory/ReporterFactory.java (1)
core/common/src/main/java/com/alipay/sofa/rpc/common/config/RpcConfigKeys.java (1)
  • RpcConfigKeys (28-155)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java (2)
core/common/src/main/java/com/alipay/sofa/rpc/common/utils/CommonUtils.java (1)
  • CommonUtils (30-278)
tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/RpcSpanTags.java (1)
  • RpcSpanTags (24-192)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: sca
🔇 Additional comments (32)
test/test-integration/src/test/java/com/alipay/sofa/rpc/triple/ark/MultiClassLoaderTest.java (1)

155-155: LGTM! Correct bug fix.

The change correctly aligns the export call with the newly created providerConfig3 instance, fixing the inconsistency where providerConfig2.export() was being called instead.

all/pom.xml (1)

65-65: Confirm tracer version 3.1.10 presence and security status.

The sofa-tracer-core version bump to 3.1.10 in all/pom.xml (line 65) is valid on Maven Central, but the OSS Index API returned no structured output when checking for vulnerabilities. Please manually verify that com.alipay:sofa-tracer-core:3.1.10 has no known security issues (e.g., via OSS Index, NVD, Snyk) before merging.

  • File: all/pom.xml, line 65
bom/pom.xml (1)

58-58: LGTM! Consistent version update.

The tracer version update is consistent with the corresponding change in all/pom.xml, ensuring unified dependency management across the project.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/TracerRecord.java (1)

21-21: LGTM! Well-documented streaming metric addition.

The new R0 constant for streaming first response latency is properly documented and aligns with the enhanced tracing capabilities for streaming RPCs introduced in this release.

Also applies to: 37-37

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/type/RpcTracerLogEnum.java (1)

31-32: LGTM! Consistent event logging infrastructure extension.

The new RPC_CLIENT_EVENT and RPC_SERVER_EVENT constants properly extend the logging infrastructure to support event-based tracing, following the established naming and parameter conventions.

core/api/src/main/java/com/alipay/sofa/rpc/context/RpcInvokeContext.java (1)

108-112: LGTM! Efficient context management with conditional setting.

The implementation correctly uses identity comparison to avoid unnecessary ThreadLocal operations when the current context is already the target context. This optimization supports the enhanced tracing lifecycle management efficiently.

Note: The method name resetContext might be slightly misleading since it doesn't always reset - consider setContextIfDifferent for clarity, though the current name aligns with the intended use case.

test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleStubStreamTest.java (2)

87-92: Good enhancement: Explicit application configuration and URL parameters.

The explicit ApplicationConfig setup and addition of appName=triple-server query parameter improve test clarity and align with the enhanced tracing capabilities introduced in this PR. This configuration supports proper application identification in RPC tracing scenarios.


125-130: Good test coverage addition for unary calls.

The new testTripleSayHello method provides valuable coverage for unary RPC calls, complementing the existing streaming test methods. The test is simple, focused, and follows the established testing patterns.

core-impl/client/src/main/java/com/alipay/sofa/rpc/client/AbstractCluster.java (1)

585-587: Good addition: Connection timing measurement for enhanced tracing.

The timing measurement for getAvailableClientTransport provides valuable performance insights as part of the enhanced RPC tracing capabilities. The implementation is efficient with minimal overhead and integrates well with the existing context management system.

The captured timing data will be useful for identifying connection bottlenecks in production environments.

test/test-integration/src/test/java/com/alipay/sofa/rpc/test/triple/stream/TripleGenericStreamTest.java (1)

65-68: Good: Explicit application configuration for provider.

Adding explicit ApplicationConfig with "triple-server" name improves test clarity and aligns with the enhanced tracing capabilities.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcServerEventJsonEncoder.java (1)

28-39: LGTM! Clean implementation of server event JSON encoder.

The implementation follows the established pattern for RPC event encoders:

  • Properly extends AbstractRpcEventJsonEncoder
  • Uses the standard encoding flow: reset buffer, append timestamp, delegate to appendSlot(), and finalize
  • Leverages RpcSpanTags.TIMESTAMP constant for consistency
  • Integrates well with the new event-based tracing infrastructure

Based on the retrieved learnings, thread safety is appropriately handled by the tracer core's JsonStringBuilder management.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/factory/ReporterFactory.java (4)

21-21: Import addition supports new event reporting functionality.

The import of SpanEventDiskReporter is appropriately added to support the new buildEventReport method.


34-34: Good practice: Making constant immutable.

Converting REPORT_TYPE to private static final improves code quality by making the configuration constant immutable and properly scoped.


39-39: Simplified variable initialization.

Removing the explicit null initialization is cleaner since Java initializes object references to null by default.


53-57: New factory method for event reporting.

The buildEventReport method provides a clean factory interface for creating SpanEventDiskReporter instances. The method signature and implementation are correct, directly returning the reporter without additional configuration logic.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/RpcClientEventJsonEncoder.java (1)

28-39: Well-implemented JSON encoder for client events.

The RpcClientEventJsonEncoder class correctly extends AbstractRpcEventJsonEncoder and implements the encode method following the established pattern:

  • Properly resets the buffer at the start
  • Uses appendBegin with the correct timestamp field from RpcSpanTags.TIMESTAMP
  • Leverages the inherited appendSlot method for common span data
  • Correctly finalizes with appendEnd and returns the JSON string

The implementation is clean and integrates well with the event reporting framework.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/tags/RpcEventTags.java (1)

23-39: Well-designed constants class for event tags.

The RpcEventTags class provides a clean centralized registry of standardized tag keys for RPC event logging. The constants are properly declared as public static final and follow consistent naming conventions:

  • Constants use appropriate UPPER_SNAKE_CASE naming
  • Values use camelCase consistent with JSON field conventions
  • Covers essential event attributes: stream ID, sequence ID, event type, status, size, thread name, and attributes

This design promotes consistency across the event reporting system and makes tag key management maintainable.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/TripleTracerAdapter.java (1)

290-303: Correct implementation of invocation type classification.

The addition of method type detection and invocation type setting is well-implemented:

  • Properly extracts MethodType from the gRPC method descriptor
  • Uses a comprehensive switch statement covering all streaming types:
    • CLIENT_STREAMINGINVOKER_TYPE_CLIENT_STREAMING
    • SERVER_STREAMINGINVOKER_TYPE_SERVER_STREAMING
    • BIDI_STREAMINGINVOKER_TYPE_BI_STREAMING
    • Default case → INVOKER_TYPE_SYNC
  • Sets the invocation type on SofaRequest before posting the ServerReceiveEvent

This enhancement enables proper classification of streaming vs synchronous calls, supporting the enhanced event-based tracing functionality introduced in this release.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/log/event/AbstractRpcEventJsonEncoder.java (2)

33-36: Well-designed abstract encoder base class.

The abstract class properly implements the SpanEncoder<SofaTracerSpan> interface with a protected JsonStringBuilder buffer field that allows subclass access. Based on retrieved learnings, thread safety for JsonStringBuilder instances is handled by the tracer core, so this approach is appropriate.


37-72: Comprehensive span data extraction and encoding logic.

The appendSlot method systematically extracts and encodes span data:

Span Context Data (lines 38-47):

  • Correctly extracts trace ID and span ID from SofaTracerSpanContext
  • Properly retrieves local and remote application names from span tags

Event Data Processing (lines 49-71):

  • Safely checks for null event data before processing
  • Handles three tag value types appropriately:
    • String tags: Direct key-value appending
    • Number tags: Proper null checking and string conversion
    • Boolean tags: Direct boolean value handling
  • Uses CommonUtils.isNotEmpty() for safe map iteration, preventing NPEs

The implementation provides a solid foundation for JSON encoding with proper error handling and type conversions.

core/api/src/main/java/com/alipay/sofa/rpc/common/RpcConstants.java (2)

140-155: LGTM! Well-structured event constants for streaming RPC tracing.

The new streaming event constants follow the established naming conventions and are properly documented. They provide clear semantic meaning for client/server send/receive events.


695-697: Good addition for tracking streaming response latency.

The INTERNAL_KEY_CLIENT_FIRST_STREAM_RESP_NANO constant follows the established pattern for internal keys and provides a clear metric for measuring the time to first response in streaming scenarios.

tracer/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/RpcSofaTracer.java (3)

100-108: Excellent addition of event-based reporting alongside digest reporting.

The integration of client and server event reporters follows the established pattern and properly extends the SofaTracer builder. This provides enhanced tracing capabilities for streaming RPCs.


160-168: Clean implementation of event report generation.

The generateEventReport method follows the same pattern as the existing generateReporter method, maintaining consistency in the codebase. The use of ReporterFactory.buildEventReport properly delegates to the factory for event-specific reporter creation.


420-427: Good addition of streaming first response time metric.

The R0 timing entry properly captures the first stream response latency and converts it from nanoseconds to microseconds, maintaining consistency with other timing metrics.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/server/triple/TripleServer.java (1)

110-110: Good refactoring to simplify service registration management.

Using interface ID strings as map keys instead of ProviderConfig objects is more efficient and cleaner. The removal of the explicit invoker counter in favor of checking invokerMap.isEmpty() simplifies the code while maintaining the same functionality.

Also applies to: 269-269, 406-406, 413-413, 423-423

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ClientHeaderClientInterceptor.java (3)

74-82: Good optimization by pre-caching context objects.

Pre-caching the contexts, request, trace context, and span at the beginning of the interceptCall method avoids repeated lookups and improves performance.


110-122: Well-implemented message size tracking and first response timing.

The code correctly:

  • Tracks the first response time for streaming metrics
  • Safely handles null checks when accumulating message sizes
  • Only performs size calculations for protobuf messages

145-161: Robust context lifecycle management in finally block.

The finally block ensures proper cleanup of contexts even in error scenarios. The conditional reset based on async request type prevents interference with synchronous calls.

remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java (3)

78-78: Good use of AtomicBoolean to prevent duplicate trace completion.

The traceEnd AtomicBoolean ensures that trace sending happens exactly once, preventing duplicate trace events in concurrent scenarios.

Also applies to: 155-155


149-166: Comprehensive error handling in close method.

The close method properly:

  • Preserves error descriptions when causes exist
  • Creates StatusRuntimeException when no cause is provided
  • Ensures trace completion for error cases
  • Properly cleans up contexts

289-296: Excellent exception handling in doOnHalfClose.

The try-catch block in doOnHalfClose ensures that any exceptions during super.onHalfClose() are properly converted to gRPC Status and the call is closed gracefully. This prevents unhandled exceptions from propagating.

if (spanEventData != null && originalSpan != null) {
if (throwable != null) {
spanEventData.addTag(RpcEventTags.STATUS, TracerResultCode.RPC_RESULT_RPC_FAILED);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Inconsistent method usage for adding size tag.

There's an inconsistency in how the size tag is added to SpanEventData:

  • Line 134 uses: spanEventData.addTag(RpcEventTags.SIZE, messageSize)
  • Line 243 uses: spanEventData.getEventTagWithNumber().put(RpcEventTags.SIZE, messageSize)

Both should use the same approach for consistency.

Apply this diff to maintain consistency:

-spanEventData.getEventTagWithNumber().put(RpcEventTags.SIZE, messageSize);
+spanEventData.addTag(RpcEventTags.SIZE, messageSize);

Also applies to: 243-243

🤖 Prompt for AI Agents
In
remoting/remoting-triple/src/main/java/com/alipay/sofa/rpc/interceptor/ServerReqHeaderInterceptor.java
at lines 134 and 243, the method used to add the size tag to SpanEventData is
inconsistent. To fix this, update line 243 to use
spanEventData.addTag(RpcEventTags.SIZE, messageSize) instead of
spanEventData.getEventTagWithNumber().put(RpcEventTags.SIZE, messageSize),
ensuring both lines use the addTag method for consistency.

Copy link
Collaborator

@chuailiwu chuailiwu left a comment

Choose a reason for hiding this comment

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

lgtm

@sunhailin-Leo sunhailin-Leo self-requested a review July 22, 2025 08:05
Copy link
Collaborator

@sunhailin-Leo sunhailin-Leo left a comment

Choose a reason for hiding this comment

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

LGTM;

@EvenLjj EvenLjj merged commit d7d0995 into master Jul 22, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants