Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-dev] Problem with SSHTargetControl.create(IProgressMonitor monitor)

For the problems I mentioned before:

      1. As mentioned before, the config create dialog should not allow user to finish without filling in password

      --This is not a problem since SSH protocal spec permits authentication without password


      2. In the method SSHTargetControl.create(IProgressMonitor monitor), there is a while loop that will never ends up if the connection is failed (which is caused by missing password), and by no means cancelling from UI

      --This is not problem if the SSHTargetControl.create(IProgressMonitor monitor) is wrapped with a UI job and the job is executed in a synchronized manner.

However, I found another problem related to the start/stop target, and open a bug 252125


Best Regards,

------
Hongchang Lin

Inactive hide details for Greg Watson <g.watson@xxxxxxxxxxxx>Greg Watson <g.watson@xxxxxxxxxxxx>


          Greg Watson <g.watson@xxxxxxxxxxxx>
          Sent by: ptp-dev-bounces@xxxxxxxxxxx

          10/25/2008 05:56 AM

          Please respond to
          Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>

To

Parallel Tools Platform general developers <ptp-dev@xxxxxxxxxxx>

cc


Subject

Re: [ptp-dev] Problem with SSHTargetControl.create(IProgressMonitor monitor)

If this is still a problem, please open a bug.

Thanks,

Greg

On Sep 25, 2008, at 3:03 AM, Hong Chang Lin wrote:
      I found a problem when connecting to a remote host with SSH:

      If there is a target control which misses the password (when creating the target control, the config create dialog allows me to finish even missing password), and invokes the
      targetControl.create(monitor) in my wroten codes. Then, the Eclipse workbench will hang up there, I can't do nothing unless I kill the Eclipse and restart again. I wrap the targetControl.create(monitor) in an Eclipse job, and block there to wait it to be finished, so no progress dialog pops up and by no means I can cancel it from UI.

      I investigated the codes, and thought the root causes lie in two places:
      1. As mentioned before, the config create dialog should not allow user to finish without filling in password
      2. In the method SSHTargetControl.create(IProgressMonitor monitor), there is a while loop that will never ends up if the connection is failed (which is caused by missing password), and by no means cancelling from UI


      Can we at least fix the 1st problem? And think about the scenario in which SSHTargetControl.create(IProgressMonitor monitor) is invoked as an API, no UI operation involed.






      public
      boolean create(IProgressMonitor monitor) throws CoreException {
      Assert.
      isNotNull(sshParameters, "missing ssh parameters");
      while
      (true) {
      try
      {
      if
      (monitor.isCanceled()) {
      disconnect();

      throw
      new CoreException(new Status(IStatus.ERROR, getPluginId(), 0, "Connection to target canceled", null));
      }
      connect();

      if
      (monitor.isCanceled()) {
      disconnect();

      throw
      new CoreException(new Status(IStatus.ERROR, getPluginId(), 0, "Connection to target canceled", null));
      }

      return
      true;
      }
      catch (RemoteConnectionException e) {
      monitor.subTask(
      "Failed: " + e.getMessage());
      /*
      * Ignore failure, unfortunately, it is not possible to know the reason.
      */

      disconnect();
      }


      try
      {
      Thread.
      sleep(2000);
      }
      catch (InterruptedException e) {
      disconnect();

      throw
      new CoreException(new Status(IStatus.CANCEL, getPluginId(), 0, "Connection to target canceled", null));
      }
      }
      }




      Best Regards,

      ------
      Hongchang Lin

      _______________________________________________
      ptp-dev mailing list

      ptp-dev@xxxxxxxxxxx
      https://dev.eclipse.org/mailman/listinfo/ptp-dev

_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev

GIF image

GIF image

GIF image


Back to the top