Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1823)

Issue 12251044: Azure provider: delete Services concurrently

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 9 months ago by rvb
Modified:
10 years, 9 months ago
Reviewers:
dimitern, mp+178091, jtvjtv, rog
Visibility:
Public.

Description

Azure provider: delete Services concurrently When destroying instances, delete the Windows Azure concurrently. It takes 2 minutes to take down a Service so will save lots of time when destroying big environments. The actual concurrency is currently disabled because of a bug in Azure (that we found during testing this branch): deleting Services concurrently sometimes causes a —badly reported— conflict error. We think this should be fixed in Azure and have reported the problem. In the meantime I think it's better to land that code than to let it rot. I deliberately didn't try to recover panics that could happen in the spawn goroutines because I think that if this happens, the whole app should be taken down (similar to what would happen now if one call to DestroyHostedService were to panic). I'm interested to know what people more versed than me in Go concurrency patterns will have to say about this branch. https://code.launchpad.net/~rvb/juju-core/concurrent-deletion/+merge/178091 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Azure provider: delete Services concurrently #

Total comments: 3

Patch Set 3 : Azure provider: delete Services concurrently #

Total comments: 2

Patch Set 4 : Azure provider: delete Services concurrently #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -25 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M environs/azure/environ.go View 1 2 2 chunks +48 lines, -10 lines 3 comments Download
M environs/azure/environ_test.go View 1 2 3 6 chunks +33 lines, -15 lines 0 comments Download

Messages

Total messages: 13
rvb
Please take a look.
10 years, 9 months ago (2013-08-01 15:07:22 UTC) #1
rvb
Please take a look.
10 years, 9 months ago (2013-08-01 15:42:43 UTC) #2
dimitern
LGTM with a few suggestions https://codereview.appspot.com/12251044/diff/3001/environs/azure/environ.go File environs/azure/environ.go (right): https://codereview.appspot.com/12251044/diff/3001/environs/azure/environ.go#newcode11 environs/azure/environ.go:11: "launchpad.net/juju-core/agent/tools" Blank line after ...
10 years, 9 months ago (2013-08-07 13:37:03 UTC) #3
rvb
Thanks for the review! > LGTM with a few suggestions > https://codereview.appspot.com/12251044/diff/3001/environs/azure/environ.go#newcode11 > environs/azure/environ.go:11: "launchpad.net/juju-core/agent/tools" ...
10 years, 9 months ago (2013-08-07 13:59:31 UTC) #4
rvb
Please take a look.
10 years, 9 months ago (2013-08-07 14:01:28 UTC) #5
dimitern
> https://codereview.appspot.com/12251044/diff/3001/environs/azure/environ_test... > environs/azure/environ_test.go:726: c.Error(fmt.Sprintf("None of the requests > matches: Method=%v, URL pattern=%v", method, urlPattern)) ...
10 years, 9 months ago (2013-08-07 14:15:00 UTC) #6
rvb
On 2013/08/07 14:15:00, dimitern wrote: > > > https://codereview.appspot.com/12251044/diff/3001/environs/azure/environ_test... > > environs/azure/environ_test.go:726: c.Error(fmt.Sprintf("None of the ...
10 years, 9 months ago (2013-08-07 14:24:49 UTC) #7
rvb
> Right, sorry, I got mixed up… but why? All right, thanks for explaining the ...
10 years, 9 months ago (2013-08-07 15:20:21 UTC) #8
rvb
Please take a look.
10 years, 9 months ago (2013-08-07 15:22:50 UTC) #9
jtvjtv
LGTM as far as the actual code is concerned, although as you know I see ...
10 years, 9 months ago (2013-08-08 07:57:51 UTC) #10
rvb
On 2013/08/08 07:57:51, jtvjtv wrote: > LGTM as far as the actual code is concerned, ...
10 years, 9 months ago (2013-08-08 09:30:23 UTC) #11
rog
Looks reasonable, but how about the suggestion below, which makes it easy for other code ...
10 years, 9 months ago (2013-08-08 12:24:10 UTC) #12
rvb
10 years, 9 months ago (2013-08-08 13:43:00 UTC) #13
On 2013/08/08 12:24:10, rog wrote:
> Looks reasonable, but how about the suggestion below,
> which makes it easy for other code to do the same
> thing?
> 
> https://codereview.appspot.com/12251044/diff/20001/environs/azure/environ.go
> File environs/azure/environ.go (right):
> 
>
https://codereview.appspot.com/12251044/diff/20001/environs/azure/environ.go#...
> environs/azure/environ.go:672: errc := make(chan error, len(instances))
> 
> Just a thought - at some point in the past I wanted
> to do something similar to this inside the ec2 provider.
> I wrote some helper code to do it (although I ended up not
> using it) which looks like it would be a good fit here.
> 
> The package is currently at code.google.com/p/rog-go/parallel;
> how about we suck it into utils/parallel and use it here.
> 
> The code would look roughly like this:
> 
> run := parallel.NewRun(maxConcurrentDeletes)
> for _, instance := range instances {
>     instance := instance
>     run.Do(func() error {
>          request := &gwacl.DestroyHostedServiceRequest{ServiceName:
serviceName}
>          return context.DestroyHostedService(request)
>     })
> }
> return run.Wait()

That sounds like an excellent suggestion.  Such a generic tool would be very
useful, especially for providers.  Let me look into it first and then I'll see
about doing that in a follow-up branch.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b