Skip to content
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

fix: Fix 100% CPU usage when webui is not available or not configured #26

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

ghislainbourgeois
Copy link
Contributor

When deploying SDCore, all services using this client code go into a tight loop using 100% of a CPU thread until webui is available and configured with a network slice.

This change adds some small sleeps that will free up some CPU time. The worst case scenario with this sleep is that the service will take 5 seconds more to get configured after initial deployment.

The PR also bumps logger_conf to the latest version, to prevent pulling in omec-project/path_util.

gab-arrobo
gab-arrobo previously approved these changes Feb 16, 2024
Copy link
Contributor

@gab-arrobo gab-arrobo left a comment

Choose a reason for hiding this comment

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

+1 (tested changes with AiaB using replace directive in amf and smf Docker images)

@@ -172,9 +172,11 @@ func (confClient *ConfigClient) subscribeToConfigPod(commChan chan *protos.Netwo
}
} else if status == connectivity.Idle {
logger.GrpcLog.Errorf("Connectivity status idle, trying to connect again")
time.Sleep(time.Second * 5)
continue
} else {
//logger.GrpcLog.Errorf("Connectivity status not ready")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this line be re-enabled? It may help for debugging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I added it back

Copy link
Contributor

@gab-arrobo gab-arrobo left a comment

Choose a reason for hiding this comment

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

+1

@gab-arrobo gab-arrobo merged commit a6c2195 into omec-project:main Feb 16, 2024
5 checks passed
@ghislainbourgeois ghislainbourgeois deleted the fix-highcpu-usage branch February 16, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants