提交 7c97c494 编写于 作者: S sjiang

8073148: "The server has decided to close this client connection" repeated continuously

Reviewed-by: jbachorik
上级 ca99d298
/* /*
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -538,6 +538,13 @@ public abstract class ClientNotifForwarder { ...@@ -538,6 +538,13 @@ public abstract class ClientNotifForwarder {
currentFetchThread = null; currentFetchThread = null;
} }
if (nr == null) {
if (logger.traceOn()) {
logger.trace("NotifFetcher-run",
"Recieved null object as notifs, stops fetching because the "
+ "notification server is terminated.");
}
}
if (nr == null || shouldStop()) { if (nr == null || shouldStop()) {
// tell that the thread is REALLY stopped // tell that the thread is REALLY stopped
setState(STOPPED); setState(STOPPED);
...@@ -657,7 +664,7 @@ public abstract class ClientNotifForwarder { ...@@ -657,7 +664,7 @@ public abstract class ClientNotifForwarder {
return null; return null;
} }
if (shouldStop()) if (shouldStop() || nr == null)
return null; return null;
startSequenceNumber = nr.getNextSequenceNumber(); startSequenceNumber = nr.getNextSequenceNumber();
......
...@@ -1254,10 +1254,11 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced { ...@@ -1254,10 +1254,11 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
if (serverTerminated) { if (serverTerminated) {
// we must not call fetchNotifs() if the server is // we must not call fetchNotifs() if the server is
// terminated (timeout elapsed). // terminated (timeout elapsed).
// // returns null to force the client to stop fetching
return new NotificationResult(0L, 0L, if (logger.debugOn()) logger.debug("fetchNotifications",
new TargetedNotification[0]); "The notification server has been closed, "
+ "returns null to force the client to stop fetching");
return null;
} }
final long csn = clientSequenceNumber; final long csn = clientSequenceNumber;
final int mn = maxNotifications; final int mn = maxNotifications;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册