-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[api] API delay before readiness #4516
base: master
Are you sure you want to change the base?
Conversation
Attentions during deployment: as it may increase the service's readiness time. We need to adjust accordingly the maximum tolerance time for the readiness probe |
@@ -27,6 +29,8 @@ type Config struct { | |||
WebsocketRateLimit int `yaml:"websocketRateLimit"` | |||
// ListenerLimit is the maximum number of listeners. | |||
ListenerLimit int `yaml:"listenerLimit"` | |||
// ReadyDuration is the duration to wait for the server to be ready. | |||
ReadyDuration time.Duration `yaml:"readyDuration"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this value set? I also don't see a default value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 is default value, which means no delay
server/itx/server.go
Outdated
@@ -231,9 +232,18 @@ func StartServer(ctx context.Context, svr *Server, probeSvr *probe.Server, cfg c | |||
log.L().Panic("Failed to stop server.", zap.Error(err)) | |||
} | |||
}() | |||
if cfg.API.ReadyDuration > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which apis or functions will be impacted? any of them could be started? e.g., heartbeat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The waiting occurs after all lifecycle items (e.g., API, P2P) have already started, except for the heartBeat logging and admin API(for debug).
From an external perspective:
- P2P is already ready and can receive blocks and actions.
- The API(e.g. http, grpc, wss) is not ready because the
GET /readiness
returns 503.
Quality Gate passedIssues Measures |
Description
The original intention was to ensure that all transactions that were not received during the restart were already included in block, thereby avoiding inconsistencies in the state of the API node.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: