fix: harden RPC timeout, threading and configuration - #6
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本次修复
针对代码审查中优先级最高的可靠性问题进行集中修复:
1. JDK Proxy 复用 RpcClient
JdkProxyFactory不再每次业务方法调用都new RpcClient()2. 增加请求级超时与 pending cleanup
rpc.request-timeout-ms,默认 5000ms3. 修复 primitive 参数/返回值
TypeUtils,支持int/long/boolean/...等基础类型名称解析int add(int, int)回归测试4. 业务逻辑移出 Netty EventLoop
NettyTransportServer创建服务级共享、有界业务线程池NettyRpcHandler只负责投递请求,反序列化、反射和业务方法在业务线程执行5. 统一 Spring Boot -> RpcConfig 配置链路
server-host / registry-address / proxy / load-balancer等 Starter 配置写入后核心层未读取的问题max-message-sizerequest-timeout-msworker-threadsboss-threadsbusiness-threadsbusiness-queue-capacitymax-connections额外修正
boss-threads/worker-threads真正用于创建 Netty EventLoopGroupvoidRPC 返回值不再尝试反序列化空响应体InvocationTargetException,返回更准确的业务异常信息测试
新增/扩展:
JdkProxyFactoryTestRpcClientTestprimitive/void caseRpcConfigTest全配置覆盖与非法整数 fallbackNettyRpcHandlerTestprimitive 参数与业务线程隔离等待 GitHub Actions 对完整 Maven 构建、单元测试和集成测试进行验证。