Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 171418

Summary: New tech Agent Controller 4.3 crashes on Linux
Product: z_Archived Reporter: Stoiko Avdjiev <stoiko.avdjiev>
Component: TPTPAssignee: Igor Alelekov <igor.alelekov>
Status: CLOSED FIXED QA Contact:
Severity: blocker    
Priority: P1 CC: andrew.kaylor, jkubasta, karla.callaghan, steven.wasleski
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: closed460
Attachments:
Description Flags
log file
none
the configuration file of the Agent Controller:
none
patch none

Description Stoiko Avdjiev CLA 2007-01-23 11:22:02 EST
Build ID: NA

Steps To Reproduce:
The problem situation involves an Agent Controller on a SLES 9 Linux machine and a client on a Windows Server 2003 machine.
A logging agent is registered in the Agent Controller. The client starts monitoring the agent and after a while the agent dies.
When the client tries to release the agent handle and disconnect from the Agent Controller, the Agent Controller has already died, so the client throws a socket exception: 

java.net.SocketException: Software caused connection abort: socket write error
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:105)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:137)
        at org.eclipse.tptp.platform.execution.client.core.internal.ConnectionImpl.sendMessage(ConnectionImpl.java:688)
        at org.eclipse.tptp.platform.execution.client.core.internal.AgentController.sendCommand(AgentController.java:1484)
        at org.eclipse.tptp.platform.execution.client.core.internal.AgentController.releaseAgent(AgentController.java:560)
        at org.eclipse.tptp.platform.execution.client.agent.internal.AgentImpl.releaseAccess(AgentImpl.java:565)




The logging agent looks like this:

import org.eclipse.hyades.logging.core.LoggingAgent;

public class MyACAgent {

	public static void main(String[] args) throws Exception {
		
		LoggingAgent loggingAgent = new LoggingAgent("myagent");
		Thread.sleep(5000);
	}
}



The client looks like this:

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 MyACClient {
    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(30000);

        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() {}
    }
}

More information:
Comment 1 Karla Callaghan CLA 2007-01-23 12:22:09 EST
Based on the import statements I see below, it looks like you have a client using the new AC client API (org.eclipse.tptp...) trying to connect to a logging agent that is using the RAC API (org.eclipse.hyades...).  These are different protocols.  The client could cause the AC to launch the agent, but I don't see how the agent would know how to register itself with the new AC as you indicate below.

However, even with a mismatch in client/agent the AC should not crash. It would be useful to attach the servicelog.log that results from a run that shows this crash.  Modifying serviceconfig.xml so that the Logging level is set to "DEBUG" and the Format set to "Simple" and restarting the AC before the run would help isolate what is happening.

Also, please set the "Version" field above to match the release in which you found the problem.
Comment 2 Stoiko Avdjiev CLA 2007-01-24 03:53:25 EST
Created attachment 57409 [details]
log file

As requested by the TPTP development team, here is the log file, generated by the Agent Controller with logging level set to "DEBUG" and format set to "Simple" :
Comment 3 Stoiko Avdjiev CLA 2007-01-24 03:54:09 EST
Created attachment 57410 [details]
the configuration file of the Agent Controller:

the configuration file of the Agent Controller:
Comment 4 Stoiko Avdjiev CLA 2007-01-24 03:54:36 EST
The Agent Controller is installed using the following archive from the TPTP site: 
	agntctrl.linux_ia32-TPTP-4.3.0-200610310100.zip
Comment 5 jkubasta CLA 2007-01-30 22:51:38 EST
Karla, please triage to 4.4
Comment 6 Karla Callaghan CLA 2007-01-31 13:32:20 EST
Set target to 4.4 and corrected version found in as 4.3.
Comment 7 Igor Alelekov CLA 2007-03-02 05:30:38 EST
Created attachment 60147 [details]
patch

Andrew, please review the patch, resolving thread race condition in ACTL.
Comment 8 Igor Alelekov CLA 2007-03-02 05:37:33 EST
*** Bug 170062 has been marked as a duplicate of this bug. ***
Comment 9 Igor Alelekov CLA 2007-03-19 03:06:22 EDT
Resolving since Andrew committed the patch.
Comment 10 Paul Slauenwhite CLA 2009-06-30 12:05:20 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.