AlinsRan commented on code in PR #1394:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/1394#discussion_r1039278171


##########
pkg/providers/controller.go:
##########
@@ -262,6 +262,16 @@ func (c *Controller) initSharedInformers() 
*providertypes.ListerInformer {
                ConfigMapLister:        configmapLister,
        }
 
+       //wait for all informer has synecd
+       apisixFactory.Start(ctx.Done())
+       kubeFactory.Start(ctx.Done())
+       cache.WaitForCacheSync(ctx.Done(),
+               listerInformer.EpInformer.HasSynced,
+               listerInformer.SvcInformer.HasSynced,
+               listerInformer.SecretInformer.HasSynced,
+               listerInformer.PodInformer.HasSynced,
+               listerInformer.ApisixUpstreamInformer.HasSynced)
+

Review Comment:
   It is wrong to start here, because the event handler function is not 
registered before starting, which will cause some events to be lost.



##########
pkg/providers/controller.go:
##########
@@ -262,6 +262,16 @@ func (c *Controller) initSharedInformers() 
*providertypes.ListerInformer {
                ConfigMapLister:        configmapLister,
        }
 
+       //wait for all informer has synecd
+       apisixFactory.Start(ctx.Done())
+       kubeFactory.Start(ctx.Done())
+       cache.WaitForCacheSync(ctx.Done(),
+               listerInformer.EpInformer.HasSynced,
+               listerInformer.SvcInformer.HasSynced,
+               listerInformer.SecretInformer.HasSynced,
+               listerInformer.PodInformer.HasSynced,
+               listerInformer.ApisixUpstreamInformer.HasSynced)
+

Review Comment:
   `apisixFactory.Start(ctx.Done())` 
   why is it needed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to