Skip to content

Commit

Permalink
Merge pull request #162 from Revolyssup/fix
Browse files Browse the repository at this point in the history
Fix failing state sync and remove extranous error log
  • Loading branch information
Revolyssup authored Oct 17, 2022
2 parents ad682e4 + d909b72 commit 638cdbd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 34 deletions.
24 changes: 12 additions & 12 deletions internal/config/default_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,18 @@ var (
PublishTo: "meshery.meshsync.core",
},
// Istio Resources
{
Name: "virtualservices.v1beta1.networking.istio.io",
PublishTo: "meshery.meshsync.istio",
},
{
Name: "gateways.v1beta1.networking.istio.io",
PublishTo: "meshery.meshsync.istio",
},
{
Name: "destinationrules.v1beta1.networking.istio.io",
PublishTo: "meshery.meshsync.istio",
},
// {
// Name: "virtualservices.v1beta1.networking.istio.io",
// PublishTo: "meshery.meshsync.istio",
// },
// {
// Name: "gateways.v1beta1.networking.istio.io",
// PublishTo: "meshery.meshsync.istio",
// },
// {
// Name: "destinationrules.v1beta1.networking.istio.io",
// PublishTo: "meshery.meshsync.istio",
// },
},
}

Expand Down
1 change: 1 addition & 0 deletions internal/pipeline/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func newStartInformersStep(stopChan chan struct{}, log logger.Handler, informer
}

func (si *StartInformers) Exec(request *pipeline.Request) *pipeline.Result {
si.informer.WaitForCacheSync(si.stopChan)
si.informer.Start(si.stopChan)
return &pipeline.Result{
Error: nil,
Expand Down
22 changes: 0 additions & 22 deletions meshsync/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ func (h *Handler) ListenToRequests() {

// TODO: Add this to the broker pkg
case "informer-store":

allInformersCacheSynced := true
// checks if all the SharedInformers cache are synced atleast once
for _, v := range h.informer.WaitForCacheSync(make(<-chan struct{})) {
if !v {
allInformersCacheSynced = false
}
}

d, err := utils.Marshal(request.Request.Payload)
// TODO: Update broker pkg in Meshkit to include Reply types
var payload struct{ Reply string }
Expand All @@ -83,19 +74,6 @@ func (h *Handler) ListenToRequests() {
continue
}
replySubject := payload.Reply

if !allInformersCacheSynced {
err = h.Broker.Publish(replySubject, &broker.Message{
EventType: broker.ErrorEvent,
Object: "Stores have not been synced. Please try again after sometime",
})
if err != nil {
h.Log.Error(err)
continue
}
continue
}

storeObjects := h.listStoreObjects()
splitSlices := splitIntoMultipleSlices(storeObjects, 5) // performance of NATS is bound to degrade if huge messages are sent

Expand Down

0 comments on commit 638cdbd

Please sign in to comment.