Open
Conversation
Author
|
@lokidundun @funky-eyes Could you please help review this PR when you have a moment? Thanks a lot! |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 2.x #8017 +/- ##
============================================
+ Coverage 72.24% 72.26% +0.01%
Complexity 876 876
============================================
Files 1310 1310
Lines 49977 50015 +38
Branches 5945 5950 +5
============================================
+ Hits 36107 36143 +36
- Misses 10917 10923 +6
+ Partials 2953 2949 -4
🚀 New features to boost your workflow:
|
Author
|
Sorry, I just ran the spotless |
Author
|
@funky-eyes This appears to be an issue with Maven itself, not due to newly added code. |
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.
Problem Background
In Docker deployment scenarios using port mapping (e.g.,
-p 21908:8091), the Seata Server listens on port 8091 inside the container. However, clients need to access it through the host's port 21908. Currently, bothSEATA_PORTandseata.server.service-portsimultaneously control both the listening port and the registration port, making separation impossible. AlthoughSEATA_IPalready supports overriding the registered IP, there is no corresponding mechanism for the port.Solution
Introduce a new optional configuration
seata.server.registry-port(environment variableSEATA_REGISTRY_PORT) that overrides only the port registered to the service discovery center (Nacos, etc.), without affecting the actual listening port of Netty. Behavior remains completely unchanged if not configured.Main Changes
resolveServicePort()and added a newresolveRegistryPort().SEATA_REGISTRY_PORTenvironment variable >seata.server.registry-portYAML configuration.NettyServerBootstrap.start()VGroupMappingStoreManager.notifyMapping()问题背景
在 Docker 部署场景中,使用端口映射(如 -p 21908:8091)时,Seata Server 在容器内监听 8091 端口。然而,客户端需要通过主机的 21908 端口访问。目前,SEATA_PORT 和 seata.server.service-port 同时控制监听端口和注册端口,无法实现分离。虽然 SEATA_IP 已支持覆盖注册 IP,但没有对应的端口机制。
解决方案
引入一个新的可选配置项 seata.server.registry-port(环境变量 SEATA_REGISTRY_PORT),它仅覆盖注册到服务发现中心(Nacos 等)的端口,而不影响 Netty 的实际监听端口。如果不配置该参数,行为将完全保持不变。
主要变更