[JBoss JIRA] (JBIDE-23904) StreamGobbler fails in 10% of cases
by Rob Stryker (JIRA)
Rob Stryker created JBIDE-23904:
-----------------------------------
Summary: StreamGobbler fails in 10% of cases
Key: JBIDE-23904
URL: https://issues.jboss.org/browse/JBIDE-23904
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: cdk
Affects Versions: 4.4.3.AM2
Reporter: Rob Stryker
The StreamGobbler implementation in CDKLaunchUtility fails in about 10% of cases. An example standalone java class with copied code demonstrates this:
https://paste.fedoraproject.org/paste/F1QIqHhefBIXCECQPW9RuV5M1UNdIGYhyRL...
After playing with it (trying to run a command with a space in the path), I discovered it failed in two different ways about 10% of the time. This is due to lack of synchronization. The thread reading the stream might be asked for its results AFTER the process has ended, but BEFORE the stream has been read completely.
Two things were needed: 1) synchronized control for extremely short calls to add a line that's been read or check if the flow has been canceled, and 2) a delay in getting hte final output even after the process has ended, as there may still be lines to read in the stream.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month
[JBoss JIRA] (JBIDE-23862) Server adapter: if "oc" in preferences is set to path with a " " syncing fails
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-23862?page=com.atlassian.jira.plugi... ]
Andre Dietisheim edited comment on JBIDE-23862 at 2/15/17 6:38 PM:
-------------------------------------------------------------------
[~jrichter1] [~jeffmaury] thx for spotting. I dont know how my patch in openshift-restclient-java even worked at some point. I can perfectly replicate the issue and found the reason(s):
* the java process builder (that's being used to launch the oc binary) wont accept commands (nor arguments) with spaces.
* the openshift-restclient-java ([AbstractOpenShiftBinaryCapability#startProcess|https://github.com/adietis...] splits the command line by whitespaces and thus trashes a command with spaces in it's path.
Nevertheless I didnt find a proper solution:
If I put the command in double quotes (like it is suggested in many entries on the net), the binary is still not being found. Any other quoting that I tried (like "\\" or "%20" or even new FIle().getCanonicalPath()) dont work either.
Postponing this non-critical issue to later.
was (Author: adietish):
[~jrichter1] thx for spotting. I dont know how my patch in openshift-restclient-java even worked at some point. I can perfectly replicate the issue and found the reason(s):
* the java process builder (that's being used to launch the oc binary) wont accept commands (nor arguments) with spaces.
* the openshift-restclient-java ([AbstractOpenShiftBinaryCapability#startProcess|https://github.com/adietis...] splits the command line by whitespaces and thus trashes a command with spaces in it's path.
Nevertheless I didnt find a proper solution:
If I put the command in double quotes (like it is suggested in many entries on the net), the binary is still not being found. Any other quoting that I tried (like "\\" or "%20" or even new FIle().getCanonicalPath()) dont work either.
Postponing this non-critical issue to later.
> Server adapter: if "oc" in preferences is set to path with a " " syncing fails
> ------------------------------------------------------------------------------
>
> Key: JBIDE-23862
> URL: https://issues.jboss.org/browse/JBIDE-23862
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.3.Final
> Reporter: Andre Dietisheim
> Assignee: Andre Dietisheim
> Fix For: 4.4.4.AM1
>
>
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
9 years, 1 month