[jbosstools-issues] [JBoss JIRA] (JBIDE-23010) landrush plugin prevents CDK server adapter from starting

Rob Stryker (JIRA) issues at jboss.org
Wed Aug 17 11:50:00 EDT 2016


    [ https://issues.jboss.org/browse/JBIDE-23010?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13280372#comment-13280372 ] 

Rob Stryker commented on JBIDE-23010:
-------------------------------------

> Is this something we can resolve on the DevStudio side?

On the dev studio side, we are using the "External Tools launch configuration", a very standard launch config in eclipse. All we're doing here is setting the command to run, args, directory, etc.  Then we're letting eclipse read the streams, and tell us when the process is complete.  So if this is a bug in how one should read streams from a process, then it's burried DEEP in eclipse, and has been for a very long time. 

To make matters worse, the StreamGobbler example written above actually matches several stackoverflow examples on how to launch a process in java and read it... so it's not just eclipse, but most likely several other java libraries that use similar code. 

To my knowledge, a process is supposed to terminate whenever the process is naturally complete. The termination of the process will cause the streams to close.  In this gist example, the solution seems simple (don't join the gobbler).  If we don't join the gobbler, then our little example gist will complete, and close the streams. Sounds good, right? No.  Because that's not the way it will work in a long-running application like eclipse that doesn't terminate. Eclipse will still be reading the streams... and the fact that eclipse is still reading the streams will prevent the process from terminating. 

Again, to repeat,  our gist  "joining" the gobbler is only to demonstrate the bug. Eclipse doesn't "join" the gobbler, but rather just keeps reading the stream. It is the reading of the stream that prevents the vagrant command from completing, not the "joining" on it. The joining of the gobbler only prevents our little gist from terminating, to demonstrate how a long-running process like eclipse would behave by simply reading the streams. 

> The return code of vagrant, I believe, will tell you if the box started.

We never find out the return code, because the process never completes, because eclipse is still reading the streams, and this prevents vagrant from completing. 

If you prefer, you could change the 'join' to some type of Thread.sleep loop that checks if the process has completed every 5 seconds for 5 minutes, 10 minutes, 1 hour, 5 hours... ...    You will find that the process never completes, and so we can never get a return code. The "join" is not the problem, and the problem is replicatable even if you remove "join" from the examples. 

> landrush plugin prevents CDK server adapter from starting
> ---------------------------------------------------------
>
>                 Key: JBIDE-23010
>                 URL: https://issues.jboss.org/browse/JBIDE-23010
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: cdk, upstream
>    Affects Versions: 4.4.1.AM3
>            Reporter: Martin Malina
>            Assignee: Rob Stryker
>            Priority: Critical
>
> Today I downloaded cdk 2.2.rc1 [1], installed all the vagrant plugins from scratch. And then I first started this from CLI - it wanted password for sudo to set up landrush. (That's another concern I have: How will this work in devstudio? Probably it won't.) 
> Then I stopped it, set up in devstudio and start there. Everything looks fine, but the server adapter is stuck at "Starting...".
> This is the console output:
> {code}
> Bringing machine 'default' up with 'virtualbox' provider...
> ==> default: Clearing any previously set forwarded ports...
> ==> default: Clearing any previously set network interfaces...
> ==> default: [landrush] virtualbox requires an additional private network; adding it
> ==> default: [landrush] starting dns server
> ==> default: Preparing network interfaces based on configuration...
>     default: Adapter 1: nat
>     default: Adapter 2: hostonly
> ==> default: Forwarding ports...
>     default: 22 (guest) => 2222 (host) (adapter 1)
> ==> default: Running 'pre-boot' VM customizations...
> ==> default: Booting VM...
> ==> default: Waiting for machine to boot. This may take a few minutes...
>     default: SSH address: 127.0.0.1:2222
>     default: SSH username: vagrant
>     default: SSH auth method: private key
>     default: Warning: Remote connection disconnect. Retrying...
>     default: Warning: Remote connection disconnect. Retrying...
>     default: Warning: Remote connection disconnect. Retrying...
> ==> default: Machine booted and ready!
> ==> default: Registering box with vagrant-registration...
> ==> default: Checking for guest additions in VM...
>     default: No guest additions were detected on the base box for this VM! Guest
>     default: additions are required for forwarded ports, shared folders, host only
>     default: networking, and more. If SSH fails on this machine, please install
>     default: the guest additions and repackage the box to continue.
>     default: 
>     default: This is not an error message; everything may continue to work properly,
>     default: in which case you may ignore this message.
> ==> default: Setting hostname...
> ==> default: Configuring and enabling network interfaces...
> [landrush] Using eth1 (172.28.128.3)
> ==> default: [landrush] adding machine entry: cdk.vm => 172.28.128.3
> ==> default: [landrush] adding static DNS entry: cdk => cdk.vm
> [landrush] Using eth1 (172.28.128.3)
> [landrush] Host DNS resolver config looks good.
> ==> default: Copying TLS certificates to /Users/rasp/jbossqa/cdk2.2.rc1/cdk/components/rhel/rhel-ose/.vagrant/machines/default/virtualbox/docker
> ==> default: Mounting SSHFS shared folder...
> ==> default: Mounting folder via SSHFS: /Users/rasp => /Users/rasp
> ==> default: Checking Mount..
> ==> default: Checking Mount..
> ==> default: Folder Successfully Mounted!
> ==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
> ==> default: flag to force provisioning. Provisioners marked to run always will still run.
> ==> default: Running provisioner: shell...
>     default: Running: inline script
> ==> default: Running provisioner: shell...
>     default: Running: inline script
> ==> default: 
> ==> default: Successfully started and provisioned VM with 2 cores and 3072 MB of memory.
> ==> default: To modify the number of cores and/or available memory set the environment variables
> ==> default: VM_CPU respectively VM_MEMORY.
> ==> default: 
> ==> default: You can now access the OpenShift console on: https://openshift.cdk:8443/console
> ==> default: 
> ==> default: To use OpenShift CLI, run:
> ==> default: $ vagrant ssh
> ==> default: $ oc login
> ==> default: 
> ==> default: Configured users are (<username>/<password>):
> ==> default: openshift-dev/devel
> ==> default: admin/admin
> ==> default: 
> ==> default: If you have the oc client library on your host, you can also login from your host.
> {code}
> These are my plugins:
> {code}
> $ vagrant plugin list
> landrush (1.1.1)
>   - Version Constraint: 1.1.1
> vagrant-registration (1.2.3)
>   - Version Constraint: 1.2.3
> vagrant-service-manager (1.3.0)
>   - Version Constraint: 1.3.0
> vagrant-share (1.1.5, system)
> vagrant-sshfs (1.2.0)
>   - Version Constraint: 1.2.0
> {code}
> [1] http://cdk-builds.usersys.redhat.com/builds/weekly/12-Aug-2016.rc1/



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jbosstools-issues mailing list