[arvados] updated: 2.1.0-3070-g658ad0086

git repository hosting git at public.arvados.org
Mon Nov 21 15:23:59 UTC 2022


Summary of changes:
 doc/admin/diagnostics.html.textile.liquid |  2 +-
 lib/diagnostics/cmd.go                    | 22 ++++++++++++++++++----
 2 files changed, 19 insertions(+), 5 deletions(-)

       via  658ad0086791ba32153fb81f7a91a2f228d71e3e (commit)
       via  37180569bd74f4cbe1797898436634a5f686d832 (commit)
      from  531fd553a1b83c546066c1d2a2619f86e17b6d20 (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 658ad0086791ba32153fb81f7a91a2f228d71e3e
Author: Tom Clegg <tom at curii.com>
Date:   Mon Nov 21 10:22:33 2022 -0500

    19364: Cancel container request when timing out.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/diagnostics/cmd.go b/lib/diagnostics/cmd.go
index 3e3ac8675..905591e0a 100644
--- a/lib/diagnostics/cmd.go
+++ b/lib/diagnostics/cmd.go
@@ -703,11 +703,10 @@ func (diag *diagnoser) runtests() {
 
 		timeout := 10 * time.Minute
 		diag.infof("container request submitted, waiting up to %v for container to run", arvados.Duration(timeout))
-		ctx, cancel = context.WithDeadline(context.Background(), time.Now().Add(timeout))
-		defer cancel()
+		deadline := time.Now().Add(timeout)
 
 		var c arvados.Container
-		for ; cr.State != arvados.ContainerRequestStateFinal; time.Sleep(2 * time.Second) {
+		for ; cr.State != arvados.ContainerRequestStateFinal && time.Now().Before(deadline); time.Sleep(2 * time.Second) {
 			ctx, cancel := context.WithDeadline(ctx, time.Now().Add(diag.timeout))
 			defer cancel()
 
@@ -728,11 +727,26 @@ func (diag *diagnoser) runtests() {
 			if c.State != cStateWas {
 				diag.debugf("container state = %s", c.State)
 			}
+
+			cancel()
 		}
 
+		if cr.State != arvados.ContainerRequestStateFinal {
+			err := client.RequestAndDecodeContext(ctx, &cr, "PATCH", "arvados/v1/container_requests/"+cr.UUID, nil, map[string]interface{}{
+				"container_request": map[string]interface{}{
+					"priority": 0,
+				}})
+			if err != nil {
+				diag.infof("error canceling container request %s: %s", cr.UUID, err)
+			} else {
+				diag.debugf("canceled container request %s", cr.UUID)
+			}
+			return fmt.Errorf("timed out waiting for container to finish; container request %s state was %q, container %s state was %q", cr.UUID, cr.State, c.UUID, c.State)
+		}
 		if c.State != arvados.ContainerStateComplete {
 			return fmt.Errorf("container request %s is final but container %s did not complete: container state = %q", cr.UUID, cr.ContainerUUID, c.State)
-		} else if c.ExitCode != 0 {
+		}
+		if c.ExitCode != 0 {
 			return fmt.Errorf("container exited %d", c.ExitCode)
 		}
 		return nil

commit 37180569bd74f4cbe1797898436634a5f686d832
Author: Tom Clegg <tom at curii.com>
Date:   Mon Nov 21 09:54:42 2022 -0500

    19364: Proofreading.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/doc/admin/diagnostics.html.textile.liquid b/doc/admin/diagnostics.html.textile.liquid
index f4157a511..ec6a9bf9d 100644
--- a/doc/admin/diagnostics.html.textile.liquid
+++ b/doc/admin/diagnostics.html.textile.liquid
@@ -24,7 +24,7 @@ When run this way, diagnostics will also include "health checks":health-checks.h
 
 h2. Using regular user privileges
 
-On any node (server node, shell node, or a workstation outside the system network), you can also run diagnostics using by setting the usual @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ environment variables. Typically this is done with a regular user account.
+On any node (server node, shell node, or a workstation outside the system network), you can also run diagnostics by setting the usual @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ environment variables. Typically this is done with a regular user account.
 
 <notextile><pre>
 $ <span class="userinput">export ARVADOS_API_HOST=zzzzz.arvadosapi.com</span>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list