> @@ -149,7 +149,8 @@ protected String createOrImportKeyPair(String region, 
> String group, TemplateOpti
>        RegionAndName regionAndGroup = new RegionAndName(region, group);
>        KeyPair keyPair;
>        // make sure that we don't request multiple keys simultaneously
> -      synchronized (credentialsMap) {
> +      // TODO: useless synchronization
> +      /*synchronized (credentialsMap)*/ {

> these are two different mechanisms.

Indeed. But from what I can see, the fact that it's a ConcurrentMap here 
doesn't prevent the race condition ;-( If we want to use ConcurrentMap properly 
here, I guess we should try to rewrite this bit to use putIfAbsent?

ap

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/498/files#r16816149

Reply via email to