You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "kutouziUk (via GitHub)" <gi...@apache.org> on 2025/06/21 05:38:53 UTC
[I] bind xid: 172.17.0.15:8092:27681535134726645, while current xid: 172.17.0.15:8092:27681535134726611 [incubator-seata]
kutouziUk opened a new issue, #7459:
URL: https://github.com/apache/incubator-seata/issues/7459
### Check Ahead
- [x] I have searched the [issues](https://github.com/seata/seata/issues) of this repository and believe that this is not a duplicate.
### Ⅰ. Issue Description
线上seata服务端从2.0.0升级到2.1.0后,出现 bind xid: 172.17.0.15:8092:27681535134726645, while current xid: 172.17.0.15:8092:27681535134726611,本地无法复现
### Ⅱ. Describe what happened
通过traceId确实发现xid窜线程了
1、活动服务,请求A-traceId(322f316e7aaf4159b5aa579aa040f5b8) ,事务发起者,申请xid: 172.17.0.15:8092:27681535134726611 调用 二维码服务 06-20 11:49:00.007 执行

2、活动服务,请求B-traceId(64eab6d5f2084ee3a5106a5b5e1a3f6c) ,事务发起者,申请xid: 172.17.0.15:8092:27681535134726627 调用 二维码服务 06-20 11:49:00.007 执行

3、通过本地调试源码,发现每次只会执行一次bind(Strinig xid)。出现上面的情况是发生了连接重用?或者2.1.0存在bug?我无法确定

4、在使用2.0.0期间未发生该问题,但是2.0.0回滚未按照时间倒序回滚会导致回滚失败,所以从2.0.0升级到2.1.0,之后偶尔会出现上面的问题。
### Ⅲ. Describe what you expected to happen
_No response_
### Ⅳ. How to reproduce it (as minimally and precisely as possible)
_No response_
### Ⅴ. Anything else we need to know?
_No response_
### Ⅵ. Environment
Seata 2.1.0
--
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: notifications-unsubscribe@seata.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] bind xid: 172.17.0.15:8092:27681535134726627, while current xid: 172.17.0.15:8092:27681535134726611 [incubator-seata]
Posted by "kutouziUk (via GitHub)" <gi...@apache.org>.
kutouziUk commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993366887
是的 我的客户端也是升级到2.1.0的。正常情况只会bind一次xid,上一次请求的xid没有被清理,就被下一个请求使用了,才会出现这种情况吧?2.0.0在使用过程中没有发生该情况
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] bind xid: 172.17.0.15:8092:27681535134726627, while current xid: 172.17.0.15:8092:27681535134726611 [incubator-seata]
Posted by "WangzJi (via GitHub)" <gi...@apache.org>.
WangzJi commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993398510
Hey @kutouziUk!
Based on our analysis of your issue, I'd suggest updating the title to better like 'Connection pool reuse causes XID binding conflict in AT mode'
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes closed issue #7459: Connection pool reuse causes XID binding conflict in AT mode
URL: https://github.com/apache/incubator-seata/issues/7459
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] bind xid: 172.17.0.15:8092:27681535134726627, while current xid: 172.17.0.15:8092:27681535134726611 [incubator-seata]
Posted by "WangzJi (via GitHub)" <gi...@apache.org>.
WangzJi commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993372170
@kutouziUk
I've confirmed this is a critical bug and am actively working on the fix.
**Root cause identified:** `ConnectionProxy.close()` missing `context.reset()` call.
**Fix in progress:** Adding proper context cleanup to prevent XID binding conflicts during connection pool reuse.
@funky-eyes Plz assign to me. Will have a PR ready soon with the complete solution and test cases.
Thanks for the excellent bug report! 👍
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "WangzJi (via GitHub)" <gi...@apache.org>.
WangzJi commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2994009007
> > > I don't think connection reuse exists. Seata acts as a proxy for third-party connection pools, and a new ConnectionProxy is constructed each time. However, it's possible that someone might proxy Seata's DataSource and create another connection pool based on connections proxied by Seata. Therefore, Seata should follow the specification and reset the context when closing connections. However, this issue is not caused by that problem. What I need to know is how the TM and RM communicate with each other.
> >
> >
> > Could it be that in some cases the context is not properly reset?
>
> This issue won't occur unless branch transactions from different global transactions reuse the same ConnectionProxy. Additionally, ConnectionProxy is not pooled. If the user reuses this ConnectionProxy, they can reproduce the issue by setting the maximum connection count to 1.
@sensenbuxi999 You can try configuring it as mentioned above to see if the issue can be reproduced.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] bind xid: 172.17.0.15:8092:27681535134726627, while current xid: 172.17.0.15:8092:27681535134726611 [incubator-seata]
Posted by "kutouziUk (via GitHub)" <gi...@apache.org>.
kutouziUk commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993374159
> [@kutouziUk](https://github.com/kutouziUk) I've confirmed this is a critical bug and am actively working on the fix.我已确认这是一个严重错误,并正在积极进行修复。
>
> **Root cause identified:** `ConnectionProxy.close()` missing `context.reset()` call.**已确定根本原因:**`ConnectionProxy.close()` 缺少 `context.reset()` 调用。
>
> **Fix in progress:** Adding proper context cleanup to prevent XID binding conflicts during connection pool reuse.**修复中:** 添加适当的上下文清理,以防止在连接池重用期间发生 XID 绑定冲突。
>
> [@funky-eyes](https://github.com/funky-eyes) Plz assign to me. Will have a PR ready soon with the complete solution and test cases.请分配给我。很快就会准备好一个 PR,其中包含完整的解决方案和测试用例。
>
> Thanks for the excellent bug report! 👍感谢您的出色错误报告! 👍
谢谢,那我现在改怎么办,如何修改2.1.0源码,只修改client端就可以吧,然后编译推到我们的私有仓库中?
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "WangzJi (via GitHub)" <gi...@apache.org>.
WangzJi commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993468456
Would you mind sharing more details so we can review the possible use cases together? This will help determine whether introducing this method would effectively solve your problem.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "kutouziUk (via GitHub)" <gi...@apache.org>.
kutouziUk commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993434366
> Hey [@kutouziUk](https://github.com/kutouziUk)! Based on our analysis of your issue, I'd suggest updating the title to better like 'Connection pool reuse causes XID binding conflict in AT mode'
我有一个疑问,请解答一下。我自己调试的时候发现每次都是新创建的ConnectionProxy
```
public ConnectionProxy(DataSourceProxy dataSourceProxy, Connection targetConnection) {
super(dataSourceProxy, targetConnection);
}
```
context 每次都是新的,什么情况下ConnectionProxy会被复用,导致context被复用了?
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993935052
https://github.com/apache/incubator-seata/pull/4039 I think this issue is somewhat similar, but it should not exist in higher versions of Seata unless there is a dependency conflict.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993931765
I don't think connection reuse exists. Seata acts as a proxy for third-party connection pools, and a new ConnectionProxy is constructed each time. However, it's possible that someone might proxy Seata's DataSource and create another connection pool based on connections proxied by Seata. Therefore, Seata should follow the specification and reset the context when closing connections. However, this issue is not caused by that problem. What I need to know is how the TM and RM communicate with each other.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] bind xid: 172.17.0.15:8092:27681535134726627, while current xid: 172.17.0.15:8092:27681535134726611 [incubator-seata]
Posted by "WangzJi (via GitHub)" <gi...@apache.org>.
WangzJi commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993384299
> > [@kutouziUk](https://github.com/kutouziUk) I've confirmed this is a critical bug and am actively working on the fix.我已确认这是一个严重错误,并正在积极进行修复。
> > **Root cause identified:** `ConnectionProxy.close()` missing `context.reset()` call.**已确定根本原因:**`ConnectionProxy.close()` 缺少 `context.reset()` 调用。
> > **Fix in progress:** Adding proper context cleanup to prevent XID binding conflicts during connection pool reuse.**修复中:** 添加适当的上下文清理,以防止在连接池重用期间发生 XID 绑定冲突。
> > [@funky-eyes](https://github.com/funky-eyes) Plz assign to me. Will have a PR ready soon with the complete solution and test cases.请分配给我。很快就会准备好一个 PR,其中包含完整的解决方案和测试用例。
> > Thanks for the excellent bug report! 👍感谢您的出色错误报告! 👍
>
> 谢谢,那我现在改怎么办,如何修改2.1.0源码,只修改client端就可以吧,然后编译推到我们的私有仓库中?
You can try to fix it using this approach:
Modify ConnectionProxy.java
File: `rm-datasource/src/main/java/org/apache/seata/rm/datasource/ConnectionProxy.java`
Add method:
```java
@Override
public void close() throws SQLException {
context.reset();
super.close();
}
```
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "WangzJi (via GitHub)" <gi...@apache.org>.
WangzJi commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993966580
> I don't think connection reuse exists. Seata acts as a proxy for third-party connection pools, and a new ConnectionProxy is constructed each time. However, it's possible that someone might proxy Seata's DataSource and create another connection pool based on connections proxied by Seata. Therefore, Seata should follow the specification and reset the context when closing connections. However, this issue is not caused by that problem. What I need to know is how the TM and RM communicate with each other.
Could it be that in some cases the context is not properly reset?
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993994978
> > I don't think connection reuse exists. Seata acts as a proxy for third-party connection pools, and a new ConnectionProxy is constructed each time. However, it's possible that someone might proxy Seata's DataSource and create another connection pool based on connections proxied by Seata. Therefore, Seata should follow the specification and reset the context when closing connections. However, this issue is not caused by that problem. What I need to know is how the TM and RM communicate with each other.
>
> Could it be that in some cases the context is not properly reset?
This issue won't occur unless branch transactions from different global transactions reuse the same ConnectionProxy. Additionally, ConnectionProxy is not pooled. If the user reuses this ConnectionProxy, they can reproduce the issue by setting the maximum connection count to 1.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2994038071
> > > > I don't think connection reuse exists. Seata acts as a proxy for third-party connection pools, and a new ConnectionProxy is constructed each time. However, it's possible that someone might proxy Seata's DataSource and create another connection pool based on connections proxied by Seata. Therefore, Seata should follow the specification and reset the context when closing connections. However, this issue is not caused by that problem. What I need to know is how the TM and RM communicate with each other.
> > >
> > >
> > > Could it be that in some cases the context is not properly reset?
> >
> >
> > This issue won't occur unless branch transactions from different global transactions reuse the same ConnectionProxy. Additionally, ConnectionProxy is not pooled. If the user reuses this ConnectionProxy, they can reproduce the issue by setting the maximum connection count to 1.
>
> [@sensenbuxi999](https://github.com/sensenbuxi999) You can try configuring it as mentioned above to see if the issue can be reproduced.
https://github.com/apache/incubator-seata/blob/2.0.0/rm-datasource/src/main/java/io/seata/rm/datasource/ConnectionProxy.java
There is no difference between the connectionproxy in version 2.0 and version 2.1. Therefore, I believe that connection reuse behavior does not exist.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] bind xid: 172.17.0.15:8092:27681535134726627, while current xid: 172.17.0.15:8092:27681535134726611 [incubator-seata]
Posted by "funky-eyes (via GitHub)" <gi...@apache.org>.
funky-eyes commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993365229
XID transmission and binding are client-side behaviors, unrelated to the 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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [I] Connection pool reuse causes XID binding conflict in AT mode [incubator-seata]
Posted by "sensenbuxi999 (via GitHub)" <gi...@apache.org>.
sensenbuxi999 commented on issue #7459:
URL: https://github.com/apache/incubator-seata/issues/7459#issuecomment-2993478004
可以 我在本地再测试看看能不能复现。线上,加一些日志 观察观察
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org