Commit 50d172ae authored by chiaming2000's avatar chiaming2000
Browse files

Java API: fixed dead lock scenario that may be introduced if server

closed connection while client is sending messages.
parent 98caebe5
Loading
Loading
Loading
Loading
+5 −11
Original line number Diff line number Diff line
@@ -480,9 +480,11 @@ public class ClientProxy {
        
        try {

            // finalizeHeader(kmreq);

            // require to obtain lock to prevent possible dead-lock
        	// such as if connection close is triggered from remote.
        	synchronized (this) {
        		kmresp = this.iohandler.getMessageHandler().write(kmreq);
        	}

            // check if we do received a response
            if (kmresp == null) {
@@ -534,14 +536,6 @@ public class ClientProxy {

        try {

            // Message.Builder message = (Builder) im.getMessage();

            // finalize and fill the required header fields for the message
            // finalizeHeader(kineticMessage);

            // get request message to send
            // Message request = message.build();

            // create context message for the async operation
            CallbackContext<T> context = new CallbackContext<T>(handler);

+8 −2
Original line number Diff line number Diff line
@@ -226,6 +226,12 @@ public class BatchBoundaryTest extends IntegrationTestCase {
			}
		} catch (KineticException e) {
			assertTrue(e.getMessage() != null);
		} finally {
		    try {
                kineticClient.close();
            } catch (KineticException e) {
                ;
            }
		}
	}

@@ -243,8 +249,8 @@ public class BatchBoundaryTest extends IntegrationTestCase {
	@Test(dataProvider = "transportProtocolOptions", enabled = true, priority = 2)
	public void testBatchOperation_OperationExceedTheMaxinumNumPerBatch_ThrowException(
			String clientName) {
		KineticClient kineticClient = creatClient(clientName);
		assertTrue(kineticClient != null);
		//KineticClient kineticClient = creatClient(clientName);
		//assertTrue(kineticClient != null);

		BatchOperation batch = null;
		try {