- [ ] I have searched the 
[issues](https://github.com/apache/incubator-dubbo/issues) of this repository 
and believe that this is not a duplicate.
- [ ] I have checked the 
[FAQ](https://github.com/apache/incubator-dubbo/blob/master/FAQ.md) of this 
repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.6.1
* Operating System version: Linux version 3.10.0-693.el7.x86_64 
([email protected]) (gcc version 4.8.5 20150623 (Red Hat 
4.8.5-16) (GCC) )
* Java version: 1.8.0_171
* zk & zk client version: 3.4.11
* curator version: 4.0.1

### 不定时出现zookeeper session timeout,重连后消费端引用@reference 为空,日志如下

### 消费端jvm日志
```
04:22:37,427  WARN [main-SendThread(hostname:2181)][zookeeper.ClientCnxn:1111] 
- Client session timed out, have not heard from server in 33959ms for sessionid 
0x10000018d38000b
04:23:07,081  INFO [main-SendThread(hostname:2181)][zookeeper.ClientCnxn:1159] 
- Client session timed out, have not heard from server in 33959ms for sessionid 
0x10000018d38000b, closing socket connection and attempting reconnect
04:23:09,992  INFO [main-EventThread][state.ConnectionStateManager:237] - State 
change: SUSPENDED
04:23:10,186  INFO [main-SendThread(hostname:2181)][zookeeper.ClientCnxn:1035] 
- Opening socket connection to server hostname/172.16.10.121:2181. Will not 
attempt to authenticate using SASL (unknown error)
04:23:10,804  INFO [main-SendThread(hostname:2181)][zookeeper.ClientCnxn:877] - 
Socket connection established to hostname/172.16.10.121:2181, initiating session
04:23:10,998  WARN [main-SendThread(hostname:2181)][zookeeper.ClientCnxn:1288] 
- Unable to reconnect to ZooKeeper service, session 0x10000018d38000b has 
expired
04:23:11,066  INFO [main-SendThread(hostname:2181)][zookeeper.ClientCnxn:1157] 
- Unable to reconnect to ZooKeeper service, session 0x10000018d38000b has 
expired, closing socket connection
04:23:11,164  WARN [main-EventThread][curator.ConnectionState:372] - Session 
expired event received
04:23:12,502  INFO [main-EventThread][zookeeper.ZooKeeper:441] - Initiating 
client connection, connectString=hostname:2181 sessionTimeout=60000 
watcher=org.apache.curator.ConnectionState@67f639d3
04:23:13,599  INFO [main-SendThread(hostname:2181)][zookeeper.ClientCnxn:1035] 
- Opening socket connection to server hostname/172.16.10.121:2181. Will not 
attempt to authenticate using SASL (unknown error)
04:23:13,671  INFO [main-SendThread(hostname:2181)][zookeeper.ClientCnxn:877] - 
Socket connection established to hostname/172.16.10.121:2181, initiating session
04:23:13,771  INFO [main-SendThread(hostname:2181)][zookeeper.ClientCnxn:1302] 
- Session establishment complete on server hostname/172.16.10.121:2181, 
sessionid = 0x10000018d38002b, negotiated timeout = 40000
04:23:13,672  INFO [main-EventThread][state.ConnectionStateManager:237] - State 
change: LOST
04:23:13,960  INFO [main-EventThread][state.ConnectionStateManager:237] - State 
change: RECONNECTED
04:23:14,708  INFO [main-EventThread][zookeeper.ClientCnxn:520] - EventThread 
shut down for session: 0x10000018d38000b
```

### zookeeper服务器日志
```
2018-09-12 02:36:05,355 [myid:] - INFO  [SessionTracker:ZooKeeperServer@354] - 
Expiring session 0x10000018dc20000, timeout of 40000ms exceeded
2018-09-12 02:36:05,356 [myid:] - INFO  [SessionTracker:ZooKeeperServer@354] - 
Expiring session 0x10000018dc20002, timeout of 40000ms exceeded
2018-09-12 02:36:05,356 [myid:] - INFO  [SessionTracker:ZooKeeperServer@354] - 
Expiring session 0x10000018dc20003, timeout of 40000ms exceeded
2018-09-12 02:36:05,356 [myid:] - INFO  [ProcessThread(sid:0 
cport:2181)::PrepRequestProcessor@487] - Processed session termination for 
sessionid: 0x10000018dc20000
2018-09-12 02:36:05,356 [myid:] - INFO  [ProcessThread(sid:0 
cport:2181)::PrepRequestProcessor@487] - Processed session termination for 
sessionid: 0x10000018dc20002
2018-09-12 02:36:05,357 [myid:] - INFO  [ProcessThread(sid:0 
cport:2181)::PrepRequestProcessor@487] - Processed session termination for 
sessionid: 0x10000018dc20003
2018-09-12 02:39:41,884 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@215] - Accepted 
socket connection from /172.16.10.123:33164
2018-09-12 02:39:41,888 [myid:] - INFO  
[NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@938] - Client 
attempting to establish new session at /172.16.10.123:33164
2018-09-12 02:39:41,996 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@683] - 
Established session 0x10000018d380001 with negotiated timeout 40000 for client 
/172.16.10.123:33164
```

[ Full content available at: 
https://github.com/apache/incubator-dubbo/issues/2526 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to