[ARVADOS] updated: 1.3.0-3080-g36e3b4021

Git user git at public.arvados.org
Thu Sep 3 21:19:56 UTC 2020


Summary of changes:
 lib/cloud/cloudtest/tester.go      | 6 +++---
 lib/dispatchcloud/worker/pool.go   | 8 ++++----
 lib/dispatchcloud/worker/verify.go | 4 +++-
 3 files changed, 10 insertions(+), 8 deletions(-)

       via  36e3b4021e376e74806df16816bd3f207ff37ecb (commit)
      from  5c5ac412b722025d1af37f81bea60a4b503ce6aa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 36e3b4021e376e74806df16816bd3f207ff37ecb
Author: Ward Vandewege <ward at curii.com>
Date:   Thu Sep 3 17:19:29 2020 -0400

    16636: Address review comments
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/lib/cloud/cloudtest/tester.go b/lib/cloud/cloudtest/tester.go
index 609383417..5288b5c76 100644
--- a/lib/cloud/cloudtest/tester.go
+++ b/lib/cloud/cloudtest/tester.go
@@ -127,7 +127,7 @@ func (t *tester) Run() bool {
 	defer t.destroyTestInstance()
 
 	bootDeadline := time.Now().Add(t.TimeoutBooting)
-	initCommand := worker.TagVerifier{nil, t.secret}.InitCommand()
+	initCommand := worker.TagVerifier{Instance: nil, Secret: t.secret, ReportVerified: nil}.InitCommand()
 
 	t.Logger.WithFields(logrus.Fields{
 		"InstanceType":         t.InstanceType.Name,
@@ -160,7 +160,7 @@ func (t *tester) Run() bool {
 		// Create() succeeded. Make sure the new instance
 		// appears right away in the Instances() list.
 		lgrC.WithField("Instance", inst.ID()).Info("created instance")
-		t.testInstance = &worker.TagVerifier{inst, t.secret}
+		t.testInstance = &worker.TagVerifier{Instance: inst, Secret: t.secret, ReportVerified: nil}
 		t.showLoginInfo()
 		err = t.refreshTestInstance()
 		if err == errTestInstanceNotFound {
@@ -236,7 +236,7 @@ func (t *tester) refreshTestInstance() error {
 			"Instance": i.ID(),
 			"Address":  i.Address(),
 		}).Info("found our instance in returned list")
-		t.testInstance = &worker.TagVerifier{i, t.secret}
+		t.testInstance = &worker.TagVerifier{Instance: i, Secret: t.secret, ReportVerified: nil}
 		if !t.showedLoginInfo {
 			t.showLoginInfo()
 		}
diff --git a/lib/dispatchcloud/worker/pool.go b/lib/dispatchcloud/worker/pool.go
index 6ca15de49..086887cb4 100644
--- a/lib/dispatchcloud/worker/pool.go
+++ b/lib/dispatchcloud/worker/pool.go
@@ -371,19 +371,19 @@ func (wp *Pool) SetIdleBehavior(id cloud.InstanceID, idleBehavior IdleBehavior)
 
 // Successful connection to the SSH daemon, update the mTimeToSSH metric
 func (wp *Pool) reportSSHConnected(inst cloud.Instance) {
+	wp.mtx.Lock()
+	defer wp.mtx.Unlock()
 	wkr := wp.workers[inst.ID()]
-	wkr.mtx.Lock()
-	defer wkr.mtx.Unlock()
 	if wkr.state != StateBooting || !wkr.firstSSHConnection.IsZero() {
 		// the node is not in booting state (can happen if a-d-c is restarted) OR
 		// this is not the first SSH connection
 		return
 	}
 
+	wkr.firstSSHConnection = time.Now()
 	if wp.mTimeToSSH != nil {
-		wp.mTimeToSSH.Observe(time.Since(wkr.appeared).Seconds())
+		wp.mTimeToSSH.Observe(wkr.firstSSHConnection.Sub(wkr.appeared).Seconds())
 	}
-	wkr.firstSSHConnection = time.Now()
 }
 
 // Add or update worker attached to the given instance.
diff --git a/lib/dispatchcloud/worker/verify.go b/lib/dispatchcloud/worker/verify.go
index 4e6ee86c6..559bb2897 100644
--- a/lib/dispatchcloud/worker/verify.go
+++ b/lib/dispatchcloud/worker/verify.go
@@ -32,7 +32,9 @@ func (tv TagVerifier) InitCommand() cloud.InitCommand {
 }
 
 func (tv TagVerifier) VerifyHostKey(pubKey ssh.PublicKey, client *ssh.Client) error {
-	tv.ReportVerified(tv.Instance)
+	if tv.ReportVerified != nil {
+		tv.ReportVerified(tv.Instance)
+	}
 	if err := tv.Instance.VerifyHostKey(pubKey, client); err != cloud.ErrNotImplemented || tv.Secret == "" {
 		// If the wrapped instance indicates it has a way to
 		// verify the key, return that decision.

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list