Oscarcheng0312 opened a new pull request, #7695:
URL: https://github.com/apache/incubator-seata/pull/7695
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Please make sure you have read and understood the contributing
guidelines -->
- [x] I have read the
[CONTRIBUTING.md](https://github.com/apache/incubator-seata/blob/2.x/CONTRIBUTING.md)
guidelines.
- [x] I have registered the PR
[changes](https://github.com/apache/incubator-seata/tree/2.x/changes).
### Ⅰ. Describe what this PR did
Enhances the heartbeat mechanism to periodically report client-side
connection pool information to the Seata server
via Seata’s private network protocol (Netty RPC).
This allows the TC to monitor HikariCP/Druid pool metrics in real time for
observability and diagnostics.
Key changes include:
- Added `sequenceNumber` and `ConnectionPoolInfo` fields to
`HeartbeatMessage`
- Introduced `createHeartbeatMessage()` in `AbstractNettyRemotingClient` for
extensible heartbeat construction
- Updated `RmNettyRemotingClient` to report connection pool metrics every 30
seconds
- Updated `ServerHeartbeatProcessor` to receive and cache client pool info
- Exposed retrieval APIs for monitoring via `ConnectionPoolInfoCache`
### Ⅱ. Does this pull request fix one issue?
No specific issue is closed, but this PR contributes to the ongoing
connection-pool monitoring feature (GSoC).
### Ⅲ. Why don't you add test cases (unit test/integration test)?
The functionality mainly extends the existing heartbeat mechanism and
introduces a cache for runtime metrics.
Follow-up PRs will include integration tests once frontend visualization and
gRPC reporting are completed.
### Ⅳ. Describe how to verify it
1. Start Seata server and a sample RM application (e.g., Seata-sample).
2. Observe heartbeat packets via debug log:
- Client periodically sends `HeartbeatMessage` containing
`ConnectionPoolInfo`.
- Server receives and logs updated metrics in `ServerHeartbeatProcessor`.
3. Use `getAllPoolInfo()` API to verify cached client pool information is
updated correctly.
### Ⅴ. Special notes for reviews
- This PR is part of GSoC 2025 Seata connection-pool monitoring and
configuration project.
- Following PR will include the controller in seata-server.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]