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

Sync may got dead lock #174

Open
mumutu66 opened this issue Oct 27, 2020 · 1 comment
Open

Sync may got dead lock #174

mumutu66 opened this issue Oct 27, 2020 · 1 comment

Comments

@mumutu66
Copy link

when using both gitsync and gitops in one docker container I always got stuck after certain times sync , I explore the code and find the lock is hold by clusterCache.processEvent then clusterCache.GetManagedLiveObjs in engine.Sync would be locked forever

since there is a timer to notify to get the sync state the resUpdated channel is useless..and remove the OnResourceUpdated in Sync function and everything goes well .

unfortunately I didn't find the root cause..

@alswl
Copy link
Contributor

alswl commented Nov 3, 2021

The clusterCache.EnsureSycned holds the c.lock, and sync() in the EnsureSynced() will accquire listSemaphore. And the watchEvents() goroutine in sync() will accquire semaphore first, then lock the c.lock in RunSynced. so dead locks happened.

I wish I explained the situation clearly.

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

No branches or pull requests

2 participants