-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
support module restarting feature #5513
Conversation
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
a86e6c2
to
85ac98b
Compare
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
@@ -30,6 +32,7 @@ func init() { | |||
type ModuleInfo struct { | |||
contextType string | |||
remote bool | |||
active bool |
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.
What is the significance of the newly added active field? Does it mean that a module was started normally?
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.
Yes, it means a module is started and running normally. In this PR it's true
if module.Start()
doesn't exits. It's for further implementation to check whether a module is online/active.
if backoffDuration < 30*time.Second { | ||
backoffDuration *= 2 | ||
if backoffDuration > 30*time.Second { | ||
backoffDuration = 30 * time.Second |
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.
We need to set the Max retry time, so process can exit after that, and the backoffDuration
also should be configurable for users.
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.
We can make it configurable in the next phase of development.
Now it's a feature in development. So we haven't add configurations yet.
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.
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
Signed-off-by: micplus <ain01a@outlook.com>
edge/pkg/edged/edged.go
Outdated
@@ -221,18 +242,18 @@ func newEdged(enable bool, nodeName, namespace string) (*edged, error) { | |||
} | |||
|
|||
func (e *edged) syncPod(podCfg *config.PodConfig) { | |||
time.Sleep(10 * time.Second) | |||
|
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.
Delete this line to fix the lint error
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.
Oh sorry, I will fixt it now
Signed-off-by: micplus <ain01a@outlook.com>
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fisherxu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Thanks for your contributions!
/lgtm
What type of PR is this?
/kind feature
What this PR does / why we need it:
To achieve the goal of module restarting on edge site.
moduleRestart
edged.syncPod
to support early exitWhich issue(s) this PR fixes:
Fixes #5134
Special notes for your reviewer:
Alpha version
Does this PR introduce a user-facing change?: