DESCRIPTION

Bug 517143: Prevent UI hangs due to reloadConnections in UI thread.

DockerConnectionManager.getInstance() will end up calling
reloadConnections() if the singleton has not yet been created. This can
happen when a user first opens the Docker Tooling perspective due to it
appearing in various createControl() methods. This code can take a few
seconds to execute so it should be done outside of the UI thread.

Change-Id: If62479fb88ab96f6d5d99bc151688b7c41308793


COMMENTS

author: Nathanael Holden
date: 2017-05-23 17:02:51.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2017-05-23 17:02:56.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/11677/

-------------------------------------
author: Brenden Conley
date: 2017-05-23 17:34:59.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/11677/ : SUCCESS

-------------------------------------
author: Kaylin Maxwell
date: 2017-05-23 17:46:17.000000000

Patch Set 1:

I think there is a potential timing issue.  The getInstance() call will return and callers may ask immediately for the list of known connections.  This may be empty.  They may add themselves as listeners, possibly before or after the connections are loaded.  I think an alternative to this is to simply call DockerConnectionManager.getInstance() in the start() method of the Docker Core plug-in Activator class which guarantees reloadConnections is done outside of the UI thread and before anything else in UI or core.  What do you think?

-------------------------------------
author: Nathanael Holden
date: 2017-05-23 18:13:57.000000000

Patch Set 1:

Does it make sense to sandwich the statement in a try-catch just to be sure it doesn't fail for any reason there and bring everything down ? Most statements under reloadConnections have reasonable handling of exceptions but who knows.

-------------------------------------
