Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Ignored
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but this shouldn't be in the Ignored category.
It should be in the Configuration category with an explanation of the new CLI flag introduced in this PR.

Makes the execution client keepalive interval configurable instead of being hardcoded to 1 minute.
8 changes: 8 additions & 0 deletions util/rpcclient/rpcclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type ClientConfig struct {
RetryErrors string `json:"retry-errors,omitempty" koanf:"retry-errors"`
RetryDelay time.Duration `json:"retry-delay,omitempty" koanf:"retry-delay"`
WebsocketMessageSizeLimit int64 `json:"websocket-message-size-limit,omitempty" koanf:"websocket-message-size-limit"`
ExecKeepAliveInterval time.Duration `json:"exec-keep-alive-interval,omitempty" koanf:"exec-keep-alive-interval"`

retryErrors *regexp.Regexp
}
Expand Down Expand Up @@ -60,6 +61,7 @@ var TestClientConfig = ClientConfig{
URL: "self",
JWTSecret: "",
WebsocketMessageSizeLimit: 256 * 1024 * 1024,
ExecKeepAliveInterval: time.Minute,
}

var DefaultClientConfig = ClientConfig{
Expand All @@ -70,6 +72,7 @@ var DefaultClientConfig = ClientConfig{
RetryErrors: "websocket: close.*|dial tcp .*|.*i/o timeout|.*connection reset by peer|.*connection refused",
ArgLogLimit: 2048,
WebsocketMessageSizeLimit: 256 * 1024 * 1024,
ExecKeepAliveInterval: time.Minute,
}

func RPCClientAddOptions(prefix string, f *pflag.FlagSet, defaultConfig *ClientConfig) {
Expand All @@ -82,6 +85,7 @@ func RPCClientAddOptions(prefix string, f *pflag.FlagSet, defaultConfig *ClientC
f.String(prefix+".retry-errors", defaultConfig.RetryErrors, "Errors matching this regular expression are automatically retried")
f.Duration(prefix+".retry-delay", defaultConfig.RetryDelay, "delay between retries")
f.Int64(prefix+".websocket-message-size-limit", defaultConfig.WebsocketMessageSizeLimit, "websocket message size limit used by the RPC client. 0 means no limit")
f.Duration(prefix+".exec-keep-alive-interval", defaultConfig.ExecKeepAliveInterval, "interval for sending keep-alive messages to execution client runs")
}

type RpcClient struct {
Expand All @@ -102,6 +106,10 @@ func (c *RpcClient) Timeout() time.Duration {
return c.config().Timeout
}

func (c *RpcClient) ExecKeepAliveInterval() time.Duration {
return c.config().ExecKeepAliveInterval
}

func (c *RpcClient) Close() {
if c.client != nil {
c.client.Close()
Expand Down
2 changes: 1 addition & 1 deletion validator/client/validation_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (r *ExecutionClientRun) SendKeepAlive(ctx context.Context) time.Duration {
if err != nil {
log.Error("execution run keepalive failed", "err", err)
}
return time.Minute // TODO: configurable
return r.client.client.ExecKeepAliveInterval()
}

func (r *ExecutionClientRun) CheckAlive(ctx context.Context) error {
Expand Down