Bug 235284 - [dstore] Cancel password change causes problem
Summary: [dstore] Cancel password change causes problem
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P1 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: David Dykstal CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 245989
  Show dependency tree
 
Reported: 2008-06-03 04:06 EDT by Masao Nishimoto CLA
Modified: 2008-09-04 05:57 EDT (History)
1 user (show)

See Also:
dmcknigh: review+


Attachments
Patch fixing both problems by handling the appropriate exception (4.06 KB, patch)
2008-08-25 18:05 EDT, David Dykstal CLA
no flags Details | Diff
Patch improving the error reporting from ClientConnection (2.08 KB, patch)
2008-09-02 12:57 EDT, Martin Oberhuber CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Masao Nishimoto CLA 2008-06-03 04:06:43 EDT
With the dstore connection, if a password is expired, password change dialog is shown.  If a user cancels the dialog, the next connect attempt does not work.

When the dialog is canceled, StandardCredentialsProvider.promptForNewPassword() throws an OperationCanceledException.  As the result, DStoreConnectorService._isConnecting is left "true", and the succeeding connect attempt is not processed.
Comment 1 Martin Oberhuber CLA 2008-06-03 04:33:20 EDT
DaveD - this sounds simple enough for 3.0.1, ok? I think this is minor since there is a workaround (disconnect / reconnect)?
Comment 2 David Dykstal CLA 2008-06-03 08:52:03 EDT
Sounds good.
Comment 3 Masao Nishimoto CLA 2008-07-25 00:41:23 EDT
Another case where _isConnecting is left true:

When a new connection is created, a user can enter a port number > 65535.  It causes an IllegalArgumentException when creating a socket during connect.  Then _isConnecting is left true, and further connect attempt is ignored.

Since disconnect menu is not available, the connection becomes useless until a user restarts the workbench.  So I changed the severity back to normal.
Comment 4 Martin Oberhuber CLA 2008-07-25 07:43:40 EDT
We've had similar issues in our commercial product some years ago, where a connection would incorrectly remain in "connecting" state and thus not be usable any more.

What we did to fix this was allow the "Disconnect" operation even while in "connecting" state, but re-interpret it as a "Cancel connect" request.

This could be implemented by storing the IProgressMonitor that's associated with a connect request in a place associated with the host or subsystem, and in the Disconnect operation, if still in "connecting" state, find the progress monitor and cancel it.

That way, there would at least be a workaround for connections that keep hanging in connecting state for whatever reason.
Comment 5 Martin Oberhuber CLA 2008-07-25 07:44:27 EDT
Given that the connection becomes unusable in the scenario mentioned, I'm raising priority to a P2.
Comment 6 David Dykstal CLA 2008-08-25 12:29:58 EDT
Altering priority for product requested bugs.
Comment 7 David Dykstal CLA 2008-08-25 18:05:13 EDT
Created attachment 110851 [details]
Patch fixing both problems by handling the appropriate exception
Comment 8 David Dykstal CLA 2008-08-25 18:10:08 EDT
DaveM -- This is a patch to code you own. Please review. Thanks!
Comment 9 David McKnight CLA 2008-08-25 20:11:45 EDT
I'm approving the patch although the details will show in english for now.  This is a rare scenario and we can fix the english when we add PII later.
Comment 10 David Dykstal CLA 2008-08-25 20:42:00 EDT
Dave -- can you change your review mark to a + to agree with your comment? Its a - right now. Thanks.
Comment 11 David Dykstal CLA 2008-08-25 21:53:34 EDT
Changes have been committed.
Comment 12 Martin Oberhuber CLA 2008-09-02 12:57:11 EDT
Created attachment 111503 [details]
Patch improving the error reporting from ClientConnection

I found two problems when reviewing the changes in ClientConnection, which are fixed in attached patch:

(1) In the SSL case, catching away the IllegalArgumentException is not a good
    idea since it could also have been thrown in code *after* the port had
    successfully been created.
    In that case, the port would not have been closed.
    It's better to explicitly check the daemon port number.

(2) Rather than wrapping the message into an exception that's not appropriate
    (because it wouldn't have a stacktrace associated, AND the original 
    exception's message is lost!), it's better to create the ConnectionStatus
    object with a message right away.
    If you don't think that's a good idea, then at the very least
    initCause() should be called on the exception:

    Exception e2 = new IllegalArgumentException(INVALID_DAEMON_PORT_NUMBER);
    e2.initCause(e);
    e = e2;

Also, UI code should be reviewed to ensure that an invalid daemon port can never be entered.

Would any of the Dave's approve my patch?
Comment 13 Martin Oberhuber CLA 2008-09-02 13:00:26 EDT
I filed bug 245989 to track cleaning up the UI and the PII.
Comment 14 Martin Oberhuber CLA 2008-09-04 05:57:15 EDT
I committed my patch since our ramp-down plan doesn't require review yet:

[235284][dstore] Safer error reporting for invalid daemon port number