8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* @test 25 * @bug 4094891 26 * @summary unable to retry call if cached connection to server is used 27 * @library ../../../../java/rmi/testlibrary 28 * @build TestLibrary JavaVM 29 * @run main/othervm DeadCachedConnection 30 */ 31 32 /* Fault: Cached connections used for remote invocations exhibited 33 * failure (sudden EOF or a TCP-related exception) immediately on 34 * sending a new request. It was then impossible to tell whether the 35 * connection had managed to transport the request before dying; even 36 * deserialization of request arguments is non-idempotent in general. 37 * 38 * In fact, this problem cannot be solved generally without rewriting 39 * the protocol. For now, the common case is the closing of an idle 40 * connection by a loaded/bored/dead server host. 41 * 42 * The fix is/was to trivially attempt to execute a non-blocking read 43 * on the connection before reusing it, to see if an exception/EOF is 44 * waiting for delivery. This is a 99%/1% solution, but until the 45 * great protocol rewrite, it's the best option. 46 * 47 * Reproducing is by establishing a connection to a registry and | 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* @test 25 * @bug 4094891 26 * @summary unable to retry call if cached connection to server is used 27 * @library ../../../../java/rmi/testlibrary 28 * @modules java.rmi/sun.rmi.registry 29 * java.rmi/sun.rmi.server 30 * java.rmi/sun.rmi.transport 31 * java.rmi/sun.rmi.transport.tcp 32 * @build TestLibrary JavaVM 33 * @run main/othervm DeadCachedConnection 34 */ 35 36 /* Fault: Cached connections used for remote invocations exhibited 37 * failure (sudden EOF or a TCP-related exception) immediately on 38 * sending a new request. It was then impossible to tell whether the 39 * connection had managed to transport the request before dying; even 40 * deserialization of request arguments is non-idempotent in general. 41 * 42 * In fact, this problem cannot be solved generally without rewriting 43 * the protocol. For now, the common case is the closing of an idle 44 * connection by a loaded/bored/dead server host. 45 * 46 * The fix is/was to trivially attempt to execute a non-blocking read 47 * on the connection before reusing it, to see if an exception/EOF is 48 * waiting for delivery. This is a 99%/1% solution, but until the 49 * great protocol rewrite, it's the best option. 50 * 51 * Reproducing is by establishing a connection to a registry and |