]
Ron Sigal updated JBREM-480:
----------------------------
Fix Version/s: (was: 2.4.0.Beta1 (Pinto))
Removed fix version.
Insure reliable tests in socket invoker for unusable socket
connections.
------------------------------------------------------------------------
Key: JBREM-480
URL:
http://jira.jboss.com/jira/browse/JBREM-480
Project: JBoss Remoting
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Affects Versions: 2.0.0.CR1 (Boon)
Reporter: Ron Sigal
Assigned To: Ron Sigal
The socket invoker needs to test for unusable socket connections, on both the client and
server side. There are currently two tests in place, only one of which is correct. On
the client side, if the shouldCheckConnection flag is set, then
MicroSocketClientInvoker.getPooledConnection() and
SocketClientInvoker.getPooledConnection() will call ClientSocketWrapper.checkConnection(),
which will call ObjectInputStream.readByte(), which throws an EOFException at end of file,
i.e., when the remote endpoint closes. If the shouldCheckConnection flag is not set, then
SocketClientInvoker.getPooledConnection() will call Socket.isConnected() on its socket,
and MicroSocketClientInvoker.getPooledConnection() makes no test. In any case,
Socket.isConnected() does not appear to be useful, since it seems that a Socket, once
connected, never returns to a disconnected state (at least in linux and jdk 1.4). On the
server side, ServerThread.acknowledge() will call ServerSocketWrapper.checkConnection(),
which behaves like ClientSocketWrapper.checkConnection(), if the shouldCheckConnection
flag is set.
The problem on the client side is that if the performVersioning flag is set, a version
byte will be read by calling InputStream.read(), which returns -1 at end of file instead
of throwing EOFException. If an InputStream at end of file is not tested for end of file,
-1 will be read and treated as an incorrect version. resulting in an Exception. There
needs to be an explicit test for -1.
On the server side, a version of -1 is set to 1, and the end of file condition is caught
later. It would be simpler to test explicitly for -1.
In any case, we need to verify that there are reliable tests in place for unusable
connections. It is difficult to see how to write a unit test that creates an error
condition on a socket, but there should be unit tests for client side and server side end
of file conditions.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: