[ARVADOS] created: 1.3.0-425-gf1d38ded6

Git user git at public.curoverse.com
Mon Mar 4 15:58:31 EST 2019


        at  f1d38ded6991f7061e2e4d9f61db3501c9c90b2b (commit)


commit f1d38ded6991f7061e2e4d9f61db3501c9c90b2b
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Mon Mar 4 15:57:05 2019 -0500

    14911: Fix initialization order.
    
    Nil az.ctx was being passed to ListKeys(), causing panic.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/lib/cloud/azure/azure.go b/lib/cloud/azure/azure.go
index b88962714..d19e4bef2 100644
--- a/lib/cloud/azure/azure.go
+++ b/lib/cloud/azure/azure.go
@@ -220,12 +220,14 @@ func newAzureInstanceSet(config json.RawMessage, dispatcherID cloud.InstanceSetI
 		return nil, err
 	}
 
-	ap := azureInstanceSet{logger: logger}
-	err = ap.setup(azcfg, string(dispatcherID))
+	az := azureInstanceSet{logger: logger}
+	az.ctx, az.stopFunc = context.WithCancel(context.Background())
+	err = az.setup(azcfg, string(dispatcherID))
 	if err != nil {
+		az.stopFunc()
 		return nil, err
 	}
-	return &ap, nil
+	return &az, nil
 }
 
 func (az *azureInstanceSet) setup(azcfg azureInstanceSetConfig, dispatcherID string) (err error) {
@@ -276,7 +278,6 @@ func (az *azureInstanceSet) setup(azcfg azureInstanceSetConfig, dispatcherID str
 	az.dispatcherID = dispatcherID
 	az.namePrefix = fmt.Sprintf("compute-%s-", az.dispatcherID)
 
-	az.ctx, az.stopFunc = context.WithCancel(context.Background())
 	go func() {
 		az.stopWg.Add(1)
 		defer az.stopWg.Done()

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list