Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357886 - When adding more than one OutputListener in hostshell, IllegalThreadStateException is thrown
Summary: When adding more than one OutputListener in hostshell, IllegalThreadStateExce...
Status: NEW
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: All Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: dsdp.tm.rse-inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-15 17:22 EDT by Yufen Kuo CLA
Modified: 2011-09-15 17:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yufen Kuo CLA 2011-09-15 17:22:22 EDT
Build Identifier: I20110613-1736

If in the code, more than one output listener is added to hostshell (hostShell.addOutputListener), you would get  java.lang.IllegalThreadStateException.

It seems in standard error's AbstractHostShellOutputReader, it does
not return the correct value for isAlive(). When the thread is already started,
isAlive() still returns false and which results :

java.lang.IllegalThreadStateException
    at java.lang.Thread.start(Thread.java:638)
    at
org.eclipse.rse.services.shells.AbstractHostShellOutputReader.startIfNotAlive(AbstractHostShellOutputReader.java:111)
    at
org.eclipse.rse.services.shells.AbstractHostShellOutputReader.addOutputListener(AbstractHostShellOutputReader.java:140)
    at
org.eclipse.rse.services.shells.HostShellProcessAdapter.<init>(HostShellProcessAdapter.java:59)
    at
org.eclipse.rse.internal.subsystems.processes.shell.linux.LinuxShellProcessService.listAllProcesses(LinuxShellProcessService.java:142)
    at
org.eclipse.rse.subsystems.processes.servicesubsystem.ProcessServiceSubSystem.listAllProcesses(ProcessServiceSubSystem.java:134)
    at
org.eclipse.rse.subsystems.processes.core.subsystem.impl.RemoteProcessSubSystemImpl.internalResolveFilterString(RemoteProcessSubSystemImpl.java:140)
    at
org.eclipse.rse.core.subsystems.SubSystem.internalResolveFilterStrings(SubSystem.java:2924)
    at
org.eclipse.rse.core.subsystems.SubSystem.resolveFilterStrings(SubSystem.java:2300)
    at
org.eclipse.rse.internal.ui.view.SystemViewFilterReferenceAdapter.internalGetChildren(SystemViewFilterReferenceAdapter.java:466)
    at
org.eclipse.rse.internal.ui.view.SystemViewFilterReferenceAdapter.getChildren(SystemViewFilterReferenceAdapter.java:284)
    at
org.eclipse.rse.internal.ui.view.SystemViewFilterReferenceAdapter.getChildren(SystemViewFilterReferenceAdapter.java:292)
    at
org.eclipse.rse.ui.operations.SystemFetchOperation.execute(SystemFetchOperation.java:441)
    at
org.eclipse.rse.ui.operations.SystemFetchOperation.run(SystemFetchOperation.java:182)
    at
org.eclipse.rse.ui.view.AbstractSystemViewAdapter.fetchDeferredChildren(AbstractSystemViewAdapter.java:2290)
    at
org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Reproducible: Always