[ARVADOS] created: 2.1.0-752-g25dae4b3a

Git user git at public.arvados.org
Tue May 4 18:20:38 UTC 2021


        at  25dae4b3a3064c2ec924a0bedfbe736c6f798768 (commit)


commit 25dae4b3a3064c2ec924a0bedfbe736c6f798768
Author: Tom Clegg <tom at curii.com>
Date:   Tue May 4 14:20:27 2021 -0400

    17587: Don't reject federated query with large limit param.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/controller/federation/list.go b/lib/controller/federation/list.go
index bc6d3e00a..183557eb1 100644
--- a/lib/controller/federation/list.go
+++ b/lib/controller/federation/list.go
@@ -205,8 +205,8 @@ func (conn *Conn) splitListRequest(ctx context.Context, opts arvados.ListOptions
 	if opts.Count != "none" {
 		return httpErrorf(http.StatusBadRequest, "cannot execute federated list query unless count==\"none\"")
 	}
-	if opts.Limit >= 0 || opts.Offset != 0 || len(opts.Order) > 0 {
-		return httpErrorf(http.StatusBadRequest, "cannot execute federated list query with limit, offset, or order parameter")
+	if (opts.Limit >= 0 && opts.Limit < int64(nUUIDs)) || opts.Offset != 0 || len(opts.Order) > 0 {
+		return httpErrorf(http.StatusBadRequest, "cannot execute federated list query with limit (%d) < nUUIDs (%d), offset (%d) > 0, or order (%v) parameter", opts.Limit, nUUIDs, opts.Offset, opts.Order)
 	}
 	if max := conn.cluster.API.MaxItemsPerResponse; nUUIDs > max {
 		return httpErrorf(http.StatusBadRequest, "cannot execute federated list query because number of UUIDs (%d) exceeds page size limit %d", nUUIDs, max)
diff --git a/lib/controller/federation/list_test.go b/lib/controller/federation/list_test.go
index e6d2816f6..2a4e230c9 100644
--- a/lib/controller/federation/list_test.go
+++ b/lib/controller/federation/list_test.go
@@ -300,6 +300,7 @@ func (s *CollectionListSuite) TestCollectionListMultiSiteExtraFilters(c *check.C
 
 func (s *CollectionListSuite) TestCollectionListMultiSiteWithCount(c *check.C) {
 	for _, count := range []string{"", "exact"} {
+		s.SetUpTest(c)
 		s.test(c, listTrial{
 			count: count,
 			limit: -1,
@@ -315,11 +316,12 @@ func (s *CollectionListSuite) TestCollectionListMultiSiteWithCount(c *check.C) {
 
 func (s *CollectionListSuite) TestCollectionListMultiSiteWithLimit(c *check.C) {
 	for _, limit := range []int64{0, 1, 2} {
+		s.SetUpTest(c)
 		s.test(c, listTrial{
 			count: "none",
 			limit: limit,
 			filters: []arvados.Filter{
-				{"uuid", "in", []string{s.uuids[0][0], s.uuids[1][0]}},
+				{"uuid", "in", []string{s.uuids[0][0], s.uuids[1][0], s.uuids[2][0]}},
 				{"uuid", "is_a", "teapot"},
 			},
 			expectCalls:  []int{0, 0, 0},
@@ -328,6 +330,22 @@ func (s *CollectionListSuite) TestCollectionListMultiSiteWithLimit(c *check.C) {
 	}
 }
 
+func (s *CollectionListSuite) TestCollectionListMultiSiteWithHighLimit(c *check.C) {
+	uuids := []string{s.uuids[0][0], s.uuids[1][0], s.uuids[2][0]}
+	for _, limit := range []int64{3, 4, 1234567890} {
+		s.SetUpTest(c)
+		s.test(c, listTrial{
+			count: "none",
+			limit: limit,
+			filters: []arvados.Filter{
+				{"uuid", "in", uuids},
+			},
+			expectUUIDs: uuids,
+			expectCalls: []int{1, 1, 1},
+		})
+	}
+}
+
 func (s *CollectionListSuite) TestCollectionListMultiSiteWithOffset(c *check.C) {
 	s.test(c, listTrial{
 		count:  "none",

commit db68198ea0882efa16f7ae2164db530499d0443f
Author: Tom Clegg <tom at curii.com>
Date:   Tue May 4 13:52:22 2021 -0400

    Don't ask nginx to log to stderr when using setuid.
    
    No issue #
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/boot/passenger.go b/lib/boot/passenger.go
index 0340ebc8c..d77a4d76e 100644
--- a/lib/boot/passenger.go
+++ b/lib/boot/passenger.go
@@ -132,7 +132,6 @@ func (runner runPassenger) Run(ctx context.Context, fail func(error), super *Sup
 			"passenger", "start",
 			"--address", host,
 			"--port", port,
-			"--log-file", "/dev/stderr",
 			"--log-level", loglevel,
 			"--no-friendly-error-pages",
 			"--disable-anonymous-telemetry",

commit a3eef556c4fe4393694383f7bfd189dfc247c5a3
Author: Tom Clegg <tom at curii.com>
Date:   Tue May 4 13:52:08 2021 -0400

    Update tests for go 1.16.
    
    No issue #
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/build/run-tests.sh b/build/run-tests.sh
index d6dc43416..e309d2401 100755
--- a/build/run-tests.sh
+++ b/build/run-tests.sh
@@ -1147,6 +1147,14 @@ test_all() {
     do_test apps/workbench_profile
 }
 
+test_go() {
+    do_test gofmt
+    for g in "${gostuff[@]}"
+    do
+        do_test "$g" go
+    done
+}
+
 help_interactive() {
     echo "== Interactive commands:"
     echo "TARGET                 (short for 'test DIR')"
diff --git a/sdk/go/arvados/duration.go b/sdk/go/arvados/duration.go
index ee482fdf3..c922f0a30 100644
--- a/sdk/go/arvados/duration.go
+++ b/sdk/go/arvados/duration.go
@@ -22,7 +22,7 @@ func (d *Duration) UnmarshalJSON(data []byte) error {
 	}
 	// Mimic error message returned by ParseDuration for a number
 	// without units.
-	return fmt.Errorf("missing unit in duration %s", data)
+	return fmt.Errorf("missing unit in duration %q", data)
 }
 
 // MarshalJSON implements json.Marshaler.
diff --git a/sdk/go/arvados/duration_test.go b/sdk/go/arvados/duration_test.go
index 86fe218c3..fa0ef0aec 100644
--- a/sdk/go/arvados/duration_test.go
+++ b/sdk/go/arvados/duration_test.go
@@ -50,13 +50,13 @@ func (s *DurationSuite) TestUnmarshalJSON(c *check.C) {
 		D Duration
 	}
 	err := json.Unmarshal([]byte(`{"D":1.234}`), &d)
-	c.Check(err, check.ErrorMatches, `missing unit in duration 1.234`)
+	c.Check(err, check.ErrorMatches, `.*missing unit in duration "?1\.234"?`)
 	err = json.Unmarshal([]byte(`{"D":"1.234"}`), &d)
-	c.Check(err, check.ErrorMatches, `.*missing unit in duration 1.234`)
+	c.Check(err, check.ErrorMatches, `.*missing unit in duration "?1\.234"?`)
 	err = json.Unmarshal([]byte(`{"D":"1"}`), &d)
-	c.Check(err, check.ErrorMatches, `.*missing unit in duration 1`)
+	c.Check(err, check.ErrorMatches, `.*missing unit in duration "?1"?`)
 	err = json.Unmarshal([]byte(`{"D":"foobar"}`), &d)
-	c.Check(err, check.ErrorMatches, `.*invalid duration foobar`)
+	c.Check(err, check.ErrorMatches, `.*invalid duration "foobar"`)
 	err = json.Unmarshal([]byte(`{"D":"60s"}`), &d)
 	c.Check(err, check.IsNil)
 	c.Check(d.D.Duration(), check.Equals, time.Minute)
diff --git a/services/keepstore/unix_volume_test.go b/services/keepstore/unix_volume_test.go
index 6b42dbc51..166085809 100644
--- a/services/keepstore/unix_volume_test.go
+++ b/services/keepstore/unix_volume_test.go
@@ -395,7 +395,7 @@ func (s *UnixVolumeSuite) TestStats(c *check.C) {
 	c.Check(err, check.NotNil)
 	c.Check(stats(), check.Matches, `.*"StatOps":[^0],.*`)
 	c.Check(stats(), check.Matches, `.*"Errors":[^0],.*`)
-	c.Check(stats(), check.Matches, `.*"\*os\.PathError":[^0].*`)
+	c.Check(stats(), check.Matches, `.*"\*(fs|os)\.PathError":[^0].*`) // os.PathError changed to fs.PathError in Go 1.16
 	c.Check(stats(), check.Matches, `.*"InBytes":0,.*`)
 	c.Check(stats(), check.Matches, `.*"OpenOps":0,.*`)
 	c.Check(stats(), check.Matches, `.*"CreateOps":0,.*`)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list