Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 166504 - connectionjava.net.SocketTimeoutException: Read timed out
Summary: connectionjava.net.SocketTimeoutException: Read timed out
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 blocker (vote)
Target Milestone: ---   Edit
Assignee: Samson Wai CLA
QA Contact:
URL:
Whiteboard: closed460
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-01 11:18 EST by Stoiko Avdjiev CLA
Modified: 2016-05-05 10:40 EDT (History)
4 users (show)

See Also:


Attachments
Batch file for running the GLA agent (981 bytes, text/plain)
2007-02-09 11:18 EST, Samson Wai CLA
no flags Details
Patch to ConnectionImpl in the new exec framework (1.67 KB, patch)
2007-02-13 10:47 EST, Samson Wai CLA
no flags Details | Diff
Patch to ConnectionImpl in the new exec framework (4.2.1) (1.61 KB, patch)
2007-02-14 13:34 EST, Samson Wai CLA
no flags Details | Diff
tptpcore.jar for the 4.2.1 release (283.45 KB, application/octet-stream)
2007-02-14 13:57 EST, Samson Wai CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stoiko Avdjiev CLA 2006-12-01 11:18:39 EST
Build ID: I20050401-1645

Steps To Reproduce:
1.client of Agent Controller (RAC Connector in Iterator mode) running on z/OS
2.Agent Controller 4.2 running on Windows XP
3.The client prints "Error while creating the data connectionjava.net.SocketTimeoutException: Read timed out" on the console and the Agent Controller crashes.



More information:
Using the following configuration:
	client of Agent Controller (RAC Connector in Iterator mode) running on z/OS
	Agent Controller 4.2 running on Windows XP

The client prints "Error while creating the data connectionjava.net.SocketTimeoutException: Read timed out" on the console and the Agent Controller crashes.


While looking for a solution, I patched the code in ConnectionImpl.java:
in the 'createDataConnection' method instead of setting the default timeout (Constants.TIMEOUT_PERIOD = 100ms) on the 'datasock' socket, I put a larger timeout : 10000ms.
With this patch, the problem disappeared.


int createDataConnection(int direction) throws IOException
{
	
	...
		
		
				datasock=new Socket(addrs[offset], _port);
				datasock.setTcpNoDelay(true);
				//datasock.setSoTimeout(Constants.TIMEOUT_PERIOD);
				datasock.setSoTimeout(10000);

	...
}
Comment 1 Guru Nagarajan CLA 2006-12-12 13:28:35 EST
What does the RAC iterator mean here.

Assigning it to Joanna since related to RAC code.
Comment 2 Samson Wai CLA 2006-12-12 15:03:26 EST
The "ConnectionImpl" class belongs to the new execution plugin "org.eclipse.tptp.platform.execution".

I am not sure what the "RAC Connector in Iterator mode" means but I guess it implements the new execution API to connect to the New Technology Agent Controller.
Comment 3 Karla Callaghan CLA 2006-12-13 01:22:32 EST
Stoiko - Please explain what you mean by "RAC Connector in Iterator mode".  Also, can you reproduce the timeout failure when running the client on a Windows system?  Linux?
Comment 4 Stoiko Avdjiev CLA 2006-12-13 09:30:40 EST
Our component is called "RAC Connector in Iterator mode". The problem could be recreated with any Java client running on z/OS connected to Agent Controller running on Windows for example with logging agent, registered by GLA.

Example client:
import java.net.InetAddress;
import org.eclipse.tptp.platform.execution.client.agent.IAgent;
import org.eclipse.tptp.platform.execution.client.core.*;
import org.eclipse.tptp.platform.execution.util.TPTPDataPath;

public class ACTest {
    public static final String AGENT_CONTROLLER_HOST = "9.182.191.77";
    public static final int AGENT_CONTROLLER_PORT = 10006;
    public static final String AGENT_NAME = "org.eclipse.tptp.legacy.myagent";
    
    
    public static void main(String args[]) throws Exception {
    	
        INode acNode = null;
        ConnectionInfo connInfo = new ConnectionInfo();
        acNode = NodeFactory.createNode(AGENT_CONTROLLER_HOST);
        connInfo.setHostName(AGENT_CONTROLLER_HOST);
        connInfo.setPort(AGENT_CONTROLLER_PORT);
        
        IAgentController ac = acNode.connect(connInfo);
        
        IAgent remoteLoggingAgent = ac.getAgent(AGENT_NAME, "org.eclipse.tptp.platform.execution.client.agent.IAgent");
        
        remoteLoggingAgent.startMonitoring(TPTPDataPath.DATA_PATH_RECEIVE, new LoggingAgentDataProcessor());
        
        Thread.sleep(5000);
        
        remoteLoggingAgent.releaseAccess();
        ac.disconnect();
    }
    
    
    
    private static class LoggingAgentDataProcessor implements IDataProcessor {
        public void incomingData(byte ignore1[], int ignore2, InetAddress ignore3) {}
        public void incomingData(char ignore1[], int ignore2, InetAddress ignore3) {}
        public void invalidDataType(byte ignore1[], int ignore2, InetAddress ignore3) {}
        public void waitingForData() {}
    }
}

We don’t observe the timeout with Windows and Linux clients.
Comment 5 Guru Nagarajan CLA 2006-12-13 13:33:01 EST
Stoiko,
 Please provide a patch for the fix needed for z/os. Please work with Joanna on filling a non-committer contribution questionnaire.
Comment 6 Stoiko Avdjiev CLA 2006-12-18 09:11:38 EST
We can not provide a fix for this defect because it requires a design decision to be taken first. At the moment we don’t have necessary expertise on the source code to be able to take the decision. This design decision should be taken by the authors/owners of the TPTP library.

We see the following options to be considered when the fix is prepared:

1/ A straightforward solution to the timeout problem would be to set a larger value of Constants.TIMEOUT_PERIOD. This, however, is a good solution - given a slow enough network connection, the problem will most certainly emerge again.

2/ A more sophisticated solution would be to add a new property in 'ConnectionInfo', which can override the default timeout period. This seems to be a good enough solution for the client side. 

However, the most disturbing aspect of the problem is still not addressed - the Agent Controller should not crash when the client times out. Since we are not familiar with the architecture and the source code of the Agent Controller, we cannot propose a solution for this problem.
Comment 7 Karla Callaghan CLA 2007-01-08 12:32:37 EST
Please file a separate bug for the AC crashing issue and cross-reference this bug.  AC is owned by separate component and needs ownership by them if it is going to get attention.
Comment 8 Steven Wasleski CLA 2007-01-18 11:26:08 EST
FYI... The bug requested in comment 7 has been opened.  It is bug 170062.
Comment 9 Stoiko Avdjiev CLA 2007-01-23 07:51:10 EST
We are ready to provide access to our test machines. The needed machines are one z/OS test machine and one Windows machine. Both machines are located in the IBM network and BSO firewall authentication is needed in order for the machines to be used.
Could you please provide an IBM contact on your team who could use these machines?

URGENT: Please provide a fix for this bug as soon as possible because we can’t exit our System Verification Testing phase without it.

Thanks.
Comment 10 Guru Nagarajan CLA 2007-01-23 09:43:06 EST
Assigning to JOanna since she is the component owner
Comment 11 Samson Wai CLA 2007-01-25 09:11:16 EST
Hi Stoiko, can you contact me for setting up the the environment on the z/OS and Windows hosts? I can access the IBM network as long as the BSO firewall allows me in. Thanks.
Comment 12 Samson Wai CLA 2007-01-31 16:09:39 EST
Set priority to P1 for 4.4 plan closure.
Comment 13 Samson Wai CLA 2007-02-09 11:18:45 EST
Created attachment 58664 [details]
Batch file for running the GLA agent

I can run "ACTest" successfully on the z/OS host "tvt2073". The agent "myagent" is running on my Windows machine.

The TPTP 4.4 driver I was using is:
http://www.eclipse.org/tptp/home/downloads/?buildId=TPTP-4.4.0-200702050100

On the Windows XP side:
1. Download and setup the TPTP 4.4 Agent Controller with no security
2. Download and setup the TPTP 4.4 GLA
3. Copy Deyan's "myagent.adapter" and "myagent.log" to the GLA's "bin" dir
4. Set PATH to point to JDK 1.5
5. Start Agent Controller
6. Copy the attached "run.bat" file to the GLA's "bin" dir
7. Run GLA using the attached "run.bat" file

On the z/OS side:
1. Set PATH to point to JDK 1.5
2. Copy "tptpcore.jar" to my home dir. This can be found from the TPTP runtime zip under the "org.eclipse.tptp.platform.execution" plugin
3. Copy "ACTest.java" to my home dir and compile it
4. Set CLASSPATH pointing to my home dir as well as "tptpcore.jar"
5. Run the "ACTest" program as "java ACTest"

Note: Make sure your firewall (whether it is BSO or your local Windows firewall) is not blocking the network traffic.
Comment 14 Samson Wai CLA 2007-02-13 10:47:48 EST
Created attachment 58859 [details]
Patch to ConnectionImpl in the new exec framework

This patch has been verified by the bug originator. The patch includes a new method allowing users to set the socket timeouts instead of hard-coding the default 100ms.
Comment 15 Samson Wai CLA 2007-02-13 12:34:46 EST
+6 hours worked.
Comment 16 Samson Wai CLA 2007-02-13 14:12:00 EST
Guru, please review the patch. Thanks.
Comment 17 Guru Nagarajan CLA 2007-02-14 10:15:06 EST
Samson the patch looks good. Please commit the change.
Comment 18 Samson Wai CLA 2007-02-14 10:22:25 EST
Fix checked into HEAD.
Comment 19 Samson Wai CLA 2007-02-14 13:34:03 EST
Created attachment 58991 [details]
Patch to ConnectionImpl in the new exec framework (4.2.1)

I have just created this patch for the TPTP 4.2.1 branch. Please give this a try.
Comment 20 Samson Wai CLA 2007-02-14 13:57:22 EST
Created attachment 58992 [details]
tptpcore.jar for the 4.2.1 release
Comment 21 Paul Slauenwhite CLA 2009-06-30 13:43:51 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.
Comment 22 Paul Slauenwhite CLA 2009-06-30 13:51:36 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since this enhancement/defect has been resolved and unverified for more than 1 year and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.