diff --git a/go.mod b/go.mod index 73ecd6c36..5ab6640d7 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( github.com/jonboulle/clockwork v0.4.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/tektoncd/pipeline v0.50.2 // indirect - github.com/tektoncd/triggers v0.25.1 // indirect + github.com/tektoncd/pipeline v0.50.3 // indirect + github.com/tektoncd/triggers v0.25.2 // indirect go.opencensus.io v0.24.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect @@ -22,7 +22,7 @@ require ( golang.org/x/sys v0.13.0 // indirect golang.org/x/term v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - google.golang.org/grpc v1.58.2 // indirect + google.golang.org/grpc v1.58.3 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect k8s.io/api v0.28.2 // indirect @@ -34,9 +34,9 @@ require ( ) require ( - github.com/openshift-pipelines/pipelines-as-code v0.21.3 + github.com/openshift-pipelines/pipelines-as-code v0.21.4 github.com/spf13/cobra v1.7.0 - github.com/tektoncd/cli v0.32.1 + github.com/tektoncd/cli v0.32.2 github.com/tektoncd/results/tools/tkn-results v0.0.0-20231019055929-46f209b0f8f5 ) @@ -280,7 +280,7 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tektoncd/chains v0.17.1 // indirect - github.com/tektoncd/hub v1.14.1 // indirect + github.com/tektoncd/hub v1.14.2 // indirect github.com/tektoncd/results v0.8.0 // indirect github.com/thales-e-security/pool v0.0.2 // indirect github.com/theupdateframework/go-tuf v0.6.1 // indirect diff --git a/go.sum b/go.sum index 6f09da0a4..ad97a546a 100644 --- a/go.sum +++ b/go.sum @@ -2231,8 +2231,8 @@ github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqi github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= -github.com/openshift-pipelines/pipelines-as-code v0.21.3 h1:7dqL4BapRkuK2KzG6lYf+QbEsJUd84bWT7Gffjlg8XM= -github.com/openshift-pipelines/pipelines-as-code v0.21.3/go.mod h1:htRYtKecGeFrfxrYzx4kdtJcDgsNrYRwltz4I5UI490= +github.com/openshift-pipelines/pipelines-as-code v0.21.4 h1:7QOlLWMArhsPJu2oPhpRSvTC0E553CoZ6BhN10vkytQ= +github.com/openshift-pipelines/pipelines-as-code v0.21.4/go.mod h1:Zg2pBr2y/XwLIpiFTlG71g3oORIMb8+7sCQaDJ7Jfss= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= @@ -2525,18 +2525,18 @@ github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= github.com/tektoncd/chains v0.17.1 h1:xHtdkm5VKJe215Upz2lcyHryZXAqZpZYbRN1K6yaR0s= github.com/tektoncd/chains v0.17.1/go.mod h1:T/o5gyFl/b96ZEo5MTz/5gaf1WsT6bHcETuBBLC2Puw= -github.com/tektoncd/cli v0.32.1 h1:8mPDU0Q4iycSz5N3gClYbfZL1dLDBwAcfKp/kPy+WAo= -github.com/tektoncd/cli v0.32.1/go.mod h1:OFToFSD7ivMDRJOUNZLpK1bYyG0OgQy7wrFch6ZZwjE= -github.com/tektoncd/hub v1.14.1 h1:EOrP7cxPg+Q/CR0M/a/1leoYaA877EizqaODqN6ml6A= -github.com/tektoncd/hub v1.14.1/go.mod h1:6nFe8mXCJjl7t/Sun5ZcEsHT/8kX8WVZrvrx2LkWfvw= -github.com/tektoncd/pipeline v0.50.2 h1:4uxwjXK71ai9U/ff2DZQ41rR8vObssjAxN8C1exI7cI= -github.com/tektoncd/pipeline v0.50.2/go.mod h1:MRjZCAtVxzDYKvKjPkbtv6kw8TCujnSlFhl0u8JXOmE= +github.com/tektoncd/cli v0.32.2 h1:pVgSJEgWUrsSjOfQAsBLmyxUpAQ5jWVhBolnq9r4Jmg= +github.com/tektoncd/cli v0.32.2/go.mod h1:2wCHE+fc4056eGMG3QsGcXdKkk9j42i77irpsahaA04= +github.com/tektoncd/hub v1.14.2 h1:lzqv88Q6yCO9d4iF0igczRIsnuTOWFguMf487AK+QUE= +github.com/tektoncd/hub v1.14.2/go.mod h1:a6REHQgYgpuj6Vt/CgOy4kyfiovzzuCepaXElPQIZ/w= +github.com/tektoncd/pipeline v0.50.3 h1:4QQza8hewF+4wdBLbRw26CDQx0/y58WYfZwQ/xAsvOQ= +github.com/tektoncd/pipeline v0.50.3/go.mod h1:33ZU30CR8Pbr6Pb4l7+Tz1oPGsJBY5yxyG8Z+ejGO0w= github.com/tektoncd/results v0.8.0 h1:C+3NmjFP1TB0OyRThPxsBFwhaNhcnL0ztq3eLfhHxO0= github.com/tektoncd/results v0.8.0/go.mod h1:fFoYhM82IazRmdFkjuP88128Rplj9hJBwB7NwkKTmaQ= github.com/tektoncd/results/tools/tkn-results v0.0.0-20231019055929-46f209b0f8f5 h1:C/oITab9wlPngsagVJokDlaU4/KMtB8V8WFw82DElSE= github.com/tektoncd/results/tools/tkn-results v0.0.0-20231019055929-46f209b0f8f5/go.mod h1:XHadiFd8ltP6Rbb9YsqX3tS1USyQyhw0ihr3fnpd3+w= -github.com/tektoncd/triggers v0.25.1 h1:1tyxkT12lAh8C+IE5hLBhWCZ6xbmOH/JUa8+ChQIvXY= -github.com/tektoncd/triggers v0.25.1/go.mod h1:pFj2FhUXjy12UOBfE2LZftlgBCUSsI4M/OA+lY+ecZQ= +github.com/tektoncd/triggers v0.25.2 h1:ijvWhGD/Ke56mmSBh9OMCPnE5GDI0x6rkNp7DwL0pS0= +github.com/tektoncd/triggers v0.25.2/go.mod h1:7j1MqZnJAXu3yO85hNzvSExYaUEVE4wMVIbF8GYEYVk= github.com/thales-e-security/pool v0.0.2 h1:RAPs4q2EbWsTit6tpzuvTFlgFRJ3S8Evf5gtvVDbmPg= github.com/thales-e-security/pool v0.0.2/go.mod h1:qtpMm2+thHtqhLzTwgDBj/OuNnMpupY8mv0Phz0gjhU= github.com/theupdateframework/go-tuf v0.6.1 h1:6J89fGjQf7s0mLmTG7p7pO/MbKOg+bIXhaLyQdmbKuE= @@ -3675,8 +3675,8 @@ google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwS google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= google.golang.org/grpc v1.56.0/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I= -google.golang.org/grpc v1.58.2/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= +google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/pkg/version.json b/pkg/version.json index 53c3746dd..675676701 100644 --- a/pkg/version.json +++ b/pkg/version.json @@ -1 +1 @@ -{"pac": "0.21.3", "tkn": "0.32.1", "opc": "devel"} +{"pac": "0.21.4", "tkn": "0.32.2", "opc": "devel"} diff --git a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/version/version.txt b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/version/version.txt index f198b15c7..3b8e435d3 100644 --- a/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/version/version.txt +++ b/vendor/github.com/openshift-pipelines/pipelines-as-code/pkg/params/version/version.txt @@ -1 +1 @@ -v0.21.2 +v0.21.3 diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 8d3a353c1..c06db679d 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -171,15 +171,10 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, ID: http2.SettingMaxFrameSize, Val: http2MaxFrameLen, }} - // TODO(zhaoq): Have a better way to signal "no limit" because 0 is - // permitted in the HTTP2 spec. - maxStreams := config.MaxStreams - if maxStreams == 0 { - maxStreams = math.MaxUint32 - } else { + if config.MaxStreams != math.MaxUint32 { isettings = append(isettings, http2.Setting{ ID: http2.SettingMaxConcurrentStreams, - Val: maxStreams, + Val: config.MaxStreams, }) } dynamicWindow := true @@ -258,7 +253,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, framer: framer, readerDone: make(chan struct{}), writerDone: make(chan struct{}), - maxStreams: maxStreams, + maxStreams: config.MaxStreams, inTapHandle: config.InTapHandle, fc: &trInFlow{limit: uint32(icwz)}, state: reachable, diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index 244123c6c..eeae92fbe 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -115,12 +115,6 @@ type serviceInfo struct { mdata any } -type serverWorkerData struct { - st transport.ServerTransport - wg *sync.WaitGroup - stream *transport.Stream -} - // Server is a gRPC server to serve RPC requests. type Server struct { opts serverOptions @@ -145,7 +139,7 @@ type Server struct { channelzID *channelz.Identifier czData *channelzData - serverWorkerChannel chan *serverWorkerData + serverWorkerChannel chan func() } type serverOptions struct { @@ -179,6 +173,7 @@ type serverOptions struct { } var defaultServerOptions = serverOptions{ + maxConcurrentStreams: math.MaxUint32, maxReceiveMessageSize: defaultServerMaxReceiveMessageSize, maxSendMessageSize: defaultServerMaxSendMessageSize, connectionTimeout: 120 * time.Second, @@ -404,6 +399,9 @@ func MaxSendMsgSize(m int) ServerOption { // MaxConcurrentStreams returns a ServerOption that will apply a limit on the number // of concurrent streams to each ServerTransport. func MaxConcurrentStreams(n uint32) ServerOption { + if n == 0 { + n = math.MaxUint32 + } return newFuncServerOption(func(o *serverOptions) { o.maxConcurrentStreams = n }) @@ -605,24 +603,19 @@ const serverWorkerResetThreshold = 1 << 16 // [1] https://github.com/golang/go/issues/18138 func (s *Server) serverWorker() { for completed := 0; completed < serverWorkerResetThreshold; completed++ { - data, ok := <-s.serverWorkerChannel + f, ok := <-s.serverWorkerChannel if !ok { return } - s.handleSingleStream(data) + f() } go s.serverWorker() } -func (s *Server) handleSingleStream(data *serverWorkerData) { - defer data.wg.Done() - s.handleStream(data.st, data.stream, s.traceInfo(data.st, data.stream)) -} - // initServerWorkers creates worker goroutines and a channel to process incoming // connections to reduce the time spent overall on runtime.morestack. func (s *Server) initServerWorkers() { - s.serverWorkerChannel = make(chan *serverWorkerData) + s.serverWorkerChannel = make(chan func()) for i := uint32(0); i < s.opts.numServerWorkers; i++ { go s.serverWorker() } @@ -982,21 +975,26 @@ func (s *Server) serveStreams(st transport.ServerTransport) { defer st.Close(errors.New("finished serving streams for the server transport")) var wg sync.WaitGroup + streamQuota := newHandlerQuota(s.opts.maxConcurrentStreams) st.HandleStreams(func(stream *transport.Stream) { wg.Add(1) + + streamQuota.acquire() + f := func() { + defer streamQuota.release() + defer wg.Done() + s.handleStream(st, stream, s.traceInfo(st, stream)) + } + if s.opts.numServerWorkers > 0 { - data := &serverWorkerData{st: st, wg: &wg, stream: stream} select { - case s.serverWorkerChannel <- data: + case s.serverWorkerChannel <- f: return default: // If all stream workers are busy, fallback to the default code path. } } - go func() { - defer wg.Done() - s.handleStream(st, stream, s.traceInfo(st, stream)) - }() + go f() }, func(ctx context.Context, method string) context.Context { if !EnableTracing { return ctx @@ -2091,3 +2089,34 @@ func validateSendCompressor(name, clientCompressors string) error { } return fmt.Errorf("client does not support compressor %q", name) } + +// atomicSemaphore implements a blocking, counting semaphore. acquire should be +// called synchronously; release may be called asynchronously. +type atomicSemaphore struct { + n atomic.Int64 + wait chan struct{} +} + +func (q *atomicSemaphore) acquire() { + if q.n.Add(-1) < 0 { + // We ran out of quota. Block until a release happens. + <-q.wait + } +} + +func (q *atomicSemaphore) release() { + // N.B. the "<= 0" check below should allow for this to work with multiple + // concurrent calls to acquire, but also note that with synchronous calls to + // acquire, as our system does, n will never be less than -1. There are + // fairness issues (queuing) to consider if this was to be generalized. + if q.n.Add(1) <= 0 { + // An acquire was waiting on us. Unblock it. + q.wait <- struct{}{} + } +} + +func newHandlerQuota(n uint32) *atomicSemaphore { + a := &atomicSemaphore{wait: make(chan struct{}, 1)} + a.n.Store(int64(n)) + return a +} diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index d3f5bcbfc..724ad2102 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.58.2" +const Version = "1.58.3" diff --git a/vendor/modules.txt b/vendor/modules.txt index 60b5faed4..cfe2ef4d0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1074,7 +1074,7 @@ github.com/opencontainers/go-digest ## explicit; go 1.18 github.com/opencontainers/image-spec/specs-go github.com/opencontainers/image-spec/specs-go/v1 -# github.com/openshift-pipelines/pipelines-as-code v0.21.3 +# github.com/openshift-pipelines/pipelines-as-code v0.21.4 ## explicit; go 1.19 github.com/openshift-pipelines/pipelines-as-code/pkg/acl github.com/openshift-pipelines/pipelines-as-code/pkg/action @@ -1388,7 +1388,7 @@ github.com/tektoncd/chains/pkg/chains/storage/pubsub github.com/tektoncd/chains/pkg/chains/storage/tekton github.com/tektoncd/chains/pkg/config github.com/tektoncd/chains/pkg/patch -# github.com/tektoncd/cli v0.32.1 +# github.com/tektoncd/cli v0.32.2 ## explicit; go 1.20 github.com/tektoncd/cli/pkg/actions github.com/tektoncd/cli/pkg/bundle @@ -1438,7 +1438,7 @@ github.com/tektoncd/cli/pkg/triggertemplate github.com/tektoncd/cli/pkg/trustedresources github.com/tektoncd/cli/pkg/version github.com/tektoncd/cli/pkg/workspaces -# github.com/tektoncd/hub v1.14.1 +# github.com/tektoncd/hub v1.14.2 ## explicit; go 1.20 github.com/tektoncd/hub/api/pkg/cli/app github.com/tektoncd/hub/api/pkg/cli/cmd @@ -1466,7 +1466,7 @@ github.com/tektoncd/hub/api/v1/gen/http/catalog/client github.com/tektoncd/hub/api/v1/gen/http/resource/client github.com/tektoncd/hub/api/v1/gen/resource github.com/tektoncd/hub/api/v1/gen/resource/views -# github.com/tektoncd/pipeline v0.50.2 +# github.com/tektoncd/pipeline v0.50.3 ## explicit; go 1.19 github.com/tektoncd/pipeline/pkg/apis/config github.com/tektoncd/pipeline/pkg/apis/pipeline @@ -1514,7 +1514,7 @@ github.com/tektoncd/results/tools/tkn-results/internal/config github.com/tektoncd/results/tools/tkn-results/internal/flags github.com/tektoncd/results/tools/tkn-results/internal/format github.com/tektoncd/results/tools/tkn-results/internal/portforward -# github.com/tektoncd/triggers v0.25.1 +# github.com/tektoncd/triggers v0.25.2 ## explicit; go 1.19 github.com/tektoncd/triggers/pkg/apis/config github.com/tektoncd/triggers/pkg/apis/triggers @@ -1908,7 +1908,7 @@ google.golang.org/genproto/googleapis/api/httpbody google.golang.org/genproto/googleapis/rpc/code google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.58.2 +# google.golang.org/grpc v1.58.3 ## explicit; go 1.19 google.golang.org/grpc google.golang.org/grpc/attributes