diff options
author | Michael Valenta | 2007-09-10 18:27:09 +0000 |
---|---|---|
committer | Michael Valenta | 2007-09-10 18:27:09 +0000 |
commit | d07cbe958aa1c7b42b2b091fbb78ef4b864b7dd4 (patch) | |
tree | 3844f4d12b180042c68bcb7339b8efc954e9b8e1 /bundles | |
parent | 56a653147793e4ea633061efb03de6aae8bc60c9 (diff) | |
download | eclipse.platform.team-d07cbe958aa1c7b42b2b091fbb78ef4b864b7dd4.tar.gz eclipse.platform.team-d07cbe958aa1c7b42b2b091fbb78ef4b864b7dd4.tar.xz eclipse.platform.team-d07cbe958aa1c7b42b2b091fbb78ef4b864b7dd4.zip |
Bug 199224 Compare With > Latest from HEAD takes ages to cancel with broken network connection
Diffstat (limited to 'bundles')
3 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMessages.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMessages.java index f861072e1..9397ebc7c 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMessages.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/CVSMessages.java @@ -246,6 +246,7 @@ public class CVSMessages extends NLS { public static String CVSWorkspaceSubscriber_1; public static String CVSWorkspaceSubscriber_2; public static String KnownRepositories_0; + public static String CVSRepositoryLocation_72; public static String CVSRepositoryLocation_73; public static String CVSRepositoryLocation_74; public static String CVSRepositoryLocation_75; diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java index 222c9368e..e18d617f3 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation.java @@ -763,7 +763,21 @@ public class CVSRepositoryLocation extends PlatformObject implements ICVSReposit } } try { - hostLock.acquire(); + boolean acquired = false; + int count = 0; + int timeout = CVSProviderPlugin.getPlugin().getTimeout(); + while (!acquired) { + try { + acquired = hostLock.acquire(1000); + } catch (InterruptedException e) { + // Ignore + } + if (timeout > 0 && count > timeout) { + throw new CVSCommunicationException(NLS.bind(CVSMessages.CVSRepositoryLocation_72, getHost())); + } + count++; + Policy.checkCanceled(monitor); + } // Allow two ticks in case of a retry monitor.beginTask(NLS.bind(CVSMessages.CVSRepositoryLocation_openingConnection, new String[] { getHost() }), 2); ensureLocationCached(); diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties index 31d4ccae6..6270f969b 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/messages.properties @@ -250,6 +250,7 @@ AnnotateListener_4=Cannot annotate a binary file. CVSWorkspaceSubscriber_1=Calculating synchronization state for {0} CVSWorkspaceSubscriber_2=An error occurred calculating the synchronization state for {0}: {1} KnownRepositories_0=Error restoring CVS repositories +CVSRepositoryLocation_72=Connection to {0} timed out while waiting for another thread to make a connection to the same host CVSRepositoryLocation_73=Error clearing preferences for CVS repository location {0} CVSRepositoryLocation_74=Error retrieving preferences for CVS repository location {0} CVSRepositoryLocation_75=Error flushing preferences for CVS repository location {0} |