Skip to content
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

什么情况下DefaultConnectionManager.getConnectionPoolAndCreateIfAbsent方法会阻塞? #1350

Closed
it-linnan opened this issue Jul 20, 2023 · 3 comments
Labels
wontfix This will not be worked on

Comments

@it-linnan
Copy link

Your question

线上环境出现RPC-02312异常,重试调用n次都报这个错。
异常堆栈如下:

com.alipay.sofa.rpc.core.exception.SofaRouteException: RPC-02312: The service addresses [m-ln-system:12200,] of service [com.wish.biz.ln.duringloan.srv.cprototype.Srv14300157:1.0] is not available,or specify url not exist in providers  

在客户端侧,执行jstack,获取当前线程,发现有一个线程状态是waiting。
线程阻塞在DefaultConnectionManager.getConnectionPoolAndCreateIfAbsent方法处:

"SOFA-CLI-RC-com.xxxxxx-76-T1" #610 daemon prio=5 os_prio=0 tid=0x00007f9c0c0b8800 nid=0x276 waiting on condition [0x00007f98cbd43000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x0000000751c4e298> (a com.alipay.remoting.util.RunStateRecordedFutureTask)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
	at java.util.concurrent.FutureTask.awaitDone(FutureTask.java:429)
	at java.util.concurrent.FutureTask.get(FutureTask.java:191)
	at com.alipay.remoting.DefaultConnectionManager.getConnectionPoolAndCreateIfAbsent(DefaultConnectionManager.java:601)
	at com.alipay.remoting.DefaultConnectionManager.getAndCreateIfAbsent(DefaultConnectionManager.java:462)
	at com.alipay.remoting.rpc.RpcClient.getConnection(RpcClient.java:769)
	at com.alipay.sofa.rpc.transport.bolt.ReuseBoltClientConnectionManager.getConnection(ReuseBoltClientConnectionManager.java:98)
	at com.alipay.sofa.rpc.transport.bolt.ReuseBoltClientConnectionManager.isConnectionFine(ReuseBoltClientConnectionManager.java:183)
	at com.alipay.sofa.rpc.transport.bolt.BoltClientTransport.isAvailable(BoltClientTransport.java:169)
	at com.alipay.sofa.rpc.client.AllConnectConnectionHolder.doubleCheck(AllConnectConnectionHolder.java:775)
	at com.alipay.sofa.rpc.client.AllConnectConnectionHolder.doReconnect(AllConnectConnectionHolder.java:864)
	at com.alipay.sofa.rpc.client.AllConnectConnectionHolder.access$100(AllConnectConnectionHolder.java:61)
	at com.alipay.sofa.rpc.client.AllConnectConnectionHolder$5.run(AllConnectConnectionHolder.java:819)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

   Locked ownable synchronizers:
	- <0x000000074e1ac110> (a java.util.concurrent.ThreadPoolExecutor$Worker)

Your scenes

describe your use scenes (why need this feature)

Your advice

describe the advice or solution you'd like

Environment

  • SOFARPC version: 5.5.5
  • JVM version (e.g. java -version): 1.8.0_161
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:
@nobodyiam
Copy link
Member

is it the same as #839 (comment) ?

@it-linnan
Copy link
Author

#839 (comment)

telnet 目标地址是通的

@stale
Copy link

stale bot commented Sep 19, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 19, 2023
@stale stale bot closed this as completed Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants