Skip to content

Commit

Permalink
update codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanato committed Nov 11, 2022
1 parent 7226739 commit 519350c
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 210 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ require (
k8s.io/client-go v0.25.3
k8s.io/code-generator v0.25.3
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280
knative.dev/hack v0.0.0-20221024013916-9d2ae47c16b2
knative.dev/hack v0.0.0-20221104013908-8f3c7050408b
knative.dev/hack/schema v0.0.0-20221024013916-9d2ae47c16b2
knative.dev/pkg v0.0.0-20221027143007-728dfd8e2862
sigs.k8s.io/release-utils v0.7.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1972,8 +1972,8 @@ k8s.io/legacy-cloud-providers v0.21.0/go.mod h1:bNxo7gDg+PGkBmT/MFZswLTWdSWK9kAl
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20221012122500-cfd413dd9e85 h1:cTdVh7LYu82xeClmfzGtgyspNh6UxpwLWGi8R4sspNo=
k8s.io/utils v0.0.0-20221012122500-cfd413dd9e85/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/hack v0.0.0-20221024013916-9d2ae47c16b2 h1:DvWcy2c6wvjDo+rPRWe9Rn5QEH8fiq/j4QWOka0wMvQ=
knative.dev/hack v0.0.0-20221024013916-9d2ae47c16b2/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/hack v0.0.0-20221104013908-8f3c7050408b h1:EqqlOqjCy/hVexdmPpUjcplO2eZc12+jTdTpodfLaI4=
knative.dev/hack v0.0.0-20221104013908-8f3c7050408b/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/hack/schema v0.0.0-20221024013916-9d2ae47c16b2 h1:X3EYiEmuqxiVSOPG1CsuRO+QUA956BvUw79A6oXrrs0=
knative.dev/hack/schema v0.0.0-20221024013916-9d2ae47c16b2/go.mod h1:GeIb+PLd5mllawcpHEGF5J5fYTQrvgEO5liao8lUKUs=
knative.dev/pkg v0.0.0-20221027143007-728dfd8e2862 h1:nN2KChHl+Cs3tGSLtmkNy21STwb0NRiWomdBw4jMSSU=
Expand Down
201 changes: 0 additions & 201 deletions third_party/VENDOR-LICENSE/github.com/LICENSE

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v1.4.6

BUG FIXES:

* server: Prevent gRPC broker goroutine leak when using `GRPCServer` type `GracefulStop()` or `Stop()` methods [[GH-220](https://github.com/hashicorp/go-plugin/pull/220)]

## v1.4.5

ENHANCEMENTS:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Copyright (c) 2016 HashiCorp, Inc.

Mozilla Public License, version 2.0

1. Definitions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,26 @@ func (s *GRPCServer) Init() error {
return nil
}

// Stop calls Stop on the underlying grpc.Server
// Stop calls Stop on the underlying grpc.Server and Close on the underlying
// grpc.Broker if present.
func (s *GRPCServer) Stop() {
s.server.Stop()

if s.broker != nil {
s.broker.Close()
s.broker = nil
}
}

// GracefulStop calls GracefulStop on the underlying grpc.Server
// GracefulStop calls GracefulStop on the underlying grpc.Server and Close on
// the underlying grpc.Broker if present.
func (s *GRPCServer) GracefulStop() {
s.server.GracefulStop()

if s.broker != nil {
s.broker.Close()
s.broker = nil
}
}

// Config is the GRPCServerConfig encoded as JSON then base64.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ func (s *RPCServer) Config() string { return "" }

// ServerProtocol impl.
func (s *RPCServer) Serve(lis net.Listener) {
defer s.done()

for {
conn, err := lis.Accept()
if err != nil {
Expand Down Expand Up @@ -82,7 +84,7 @@ func (s *RPCServer) ServeConn(conn io.ReadWriteCloser) {

// Connect the stdstreams (in, out, err)
stdstream := make([]net.Conn, 2)
for i, _ := range stdstream {
for i := range stdstream {
stdstream[i], err = mux.Accept()
if err != nil {
mux.Close()
Expand Down Expand Up @@ -133,13 +135,15 @@ type controlServer struct {
// Ping can be called to verify the connection (and likely the binary)
// is still alive to a plugin.
func (c *controlServer) Ping(
null bool, response *struct{}) error {
null bool, response *struct{},
) error {
*response = struct{}{}
return nil
}

func (c *controlServer) Quit(
null bool, response *struct{}) error {
null bool, response *struct{},
) error {
// End the server
c.server.done()

Expand All @@ -156,7 +160,8 @@ type dispenseServer struct {
}

func (d *dispenseServer) Dispense(
name string, response *uint32) error {
name string, response *uint32,
) error {
// Find the function to create this implementation
p, ok := d.plugins[name]
if !ok {
Expand Down

0 comments on commit 519350c

Please sign in to comment.