Skip to content

Commit

Permalink
fix(server): Only hydrate nodes if they are needed. Fixes #6000 (#6004)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed May 27, 2021
1 parent c21af21 commit e566c10
Show file tree
Hide file tree
Showing 7 changed files with 263 additions and 167 deletions.
5 changes: 5 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2204,6 +2204,11 @@
"description": "The continue option should be set when retrieving more results from the server. Since this value is\nserver defined, clients may only use the continue value from a previous query result with identical\nquery parameters (except for the value of continue) and the server may reject a continue value it\ndoes not recognize. If the specified continue value is no longer valid whether due to expiration\n(generally five to fifteen minutes) or a configuration change on the server, the server will\nrespond with a 410 ResourceExpired error together with a continue token. If the client needs a\nconsistent list, it must restart their list without the continue field. Otherwise, the client may\nsend another list request with the token received with the 410 error, the server will respond with\na list starting from the next key, but from the latest snapshot, which is inconsistent from the\nprevious list results - objects that are created, modified, or deleted after the first list request\nwill be included in the response, as long as their keys are after the \"next key\".\n\nThis field is not supported when watch is true. Clients may start a watch from the last\nresourceVersion value returned by the server and not miss any modifications.",
"name": "listOptions.continue",
"in": "query"
},
{
"type": "string",
"name": "fields",
"in": "query"
}
],
"responses": {
Expand Down
15 changes: 15 additions & 0 deletions cmd/argo/commands/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ package commands
import (
"crypto/tls"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"reflect"
"strconv"
"time"

eventsource "github.com/argoproj/argo-events/pkg/client/eventsource/clientset/versioned"
Expand Down Expand Up @@ -153,6 +156,18 @@ See %s`, help.ArgoSever),
return err
}

// disabled by default, for security
if x, enabled := os.LookupEnv("ARGO_SERVER_PPROF"); enabled {
port, err := strconv.Atoi(x)
if err != nil {
return err
}
go func() {
log.Infof("starting server for pprof on :%d, see https://golang.org/pkg/net/http/pprof/", port)
log.Println(http.ListenAndServe(fmt.Sprintf(":%d", port), nil))
}()
}

server.Run(ctx, port, browserOpenFunc)
return nil
},
Expand Down
157 changes: 104 additions & 53 deletions pkg/apiclient/workflow/workflow.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/apiclient/workflow/workflow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ message WorkflowDeleteResponse {
message WatchWorkflowsRequest {
string namespace = 1;
k8s.io.apimachinery.pkg.apis.meta.v1.ListOptions listOptions = 2;
string fields = 3;
}

message WorkflowWatchEvent {
Expand Down
Loading

0 comments on commit e566c10

Please sign in to comment.