Skip to content

Commit

Permalink
Fix/Avoid 100% CPU utilization (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
gab-arrobo authored Feb 28, 2025
1 parent bc95827 commit e1d9bba
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.4-dev
1.6.4
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/omec-project/aper v1.2.2
github.com/omec-project/config5g v1.5.7
github.com/omec-project/config5g v1.5.8
github.com/omec-project/nas v1.4.4
github.com/omec-project/ngap v1.3.1
github.com/omec-project/openapi v1.3.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/omec-project/aper v1.2.2 h1:n3W4d5w8yYJlQB0jV5rr0GRAFy6k0raKOkMzNtHESlM=
github.com/omec-project/aper v1.2.2/go.mod h1:WwFiQVcKa8MGeHoZnKjhwb4ECbOvxk4VyqzeEICrjdc=
github.com/omec-project/config5g v1.5.7 h1:aEpq0/qi8AdwU5NmyX2cfdHhDdnoiq/kuaXBdRa723Q=
github.com/omec-project/config5g v1.5.7/go.mod h1:khrzrBBPugW6zRNiJlN8/kS8XjvuNj+CUfqSZFxqjmY=
github.com/omec-project/config5g v1.5.8 h1:ilcAjpxVyaf5YFK6fBvNMc4fX1hWzH4y1978EsBDaHI=
github.com/omec-project/config5g v1.5.8/go.mod h1:khrzrBBPugW6zRNiJlN8/kS8XjvuNj+CUfqSZFxqjmY=
github.com/omec-project/nas v1.4.4 h1:4FOTbQeOI5ibVpBUueMDKEZfg0H753awSY3jvep3Vzo=
github.com/omec-project/nas v1.4.4/go.mod h1:W2kMsSs0z6naEwenUTuR9sejzLSmHdkilepvFK/NaMk=
github.com/omec-project/ngap v1.3.1 h1:I4qdtCWcheJW2g2UH5C6zP4gVlzoZWDy7f5sJLuoMEQ=
Expand Down
4 changes: 3 additions & 1 deletion service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func manageGrpcClient(webuiUri string, amf *AMF) {
count := 0
for {
if client != nil {
if client.CheckGrpcConnectivity() != "ready" {
if client.CheckGrpcConnectivity() != "READY" {
time.Sleep(time.Second * 30)
count++
if count > 5 {
Expand Down Expand Up @@ -194,6 +194,8 @@ func manageGrpcClient(webuiUri string, amf *AMF) {
go amf.UpdateConfig(configChannel)
logger.InitLog.Infoln("AMF updateConfig is triggered")
}

time.Sleep(time.Second * 5) // Fixes (avoids) 100% CPU utilization
} else {
client, err = grpcClient.ConnectToConfigServer(webuiUri)
stream = nil
Expand Down

0 comments on commit e1d9bba

Please sign in to comment.