Skip to content

Conversation

FxKu
Copy link
Member

@FxKu FxKu commented May 13, 2022

Another continuation of #1876. It takes the idea of #1888 sending a poison pill to the processPodEvent function inside the cluster go routine. But instead of using a podEvent that has to queue up, we are using a second channel next to the podEvents channel of cluster.podSubscribers map. The latter is not a map of channels anymore, but a map of podSubscriber struct consisting of two channels.

When waitForPodLabel is finished with consuming podEvents it will write on the second channel which will trigger the removal of podSubscribers. So a next podEvent should not find the subscriber anymore and not write on a closed channel.

fixes: #1867
closes #1876
closes #1888

@FxKu FxKu changed the title Switchover subscriber fix 3 Use second channel for podSubscribers to trigger its removal by cluster go routine May 13, 2022
@FxKu FxKu added this to the 1.8.1 milestone May 13, 2022
defer func() {
subscriber.stopEvent <- struct{}{}
}()
defer close(stopCh)
Copy link
Member

Choose a reason for hiding this comment

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

do we still need or use stopCh?

@FxKu FxKu force-pushed the switchover-subscriber-fix-3 branch from 351caa5 to cc4920f Compare May 17, 2022 16:34
@FxKu
Copy link
Member Author

FxKu commented May 19, 2022

closing since #1876 already solved #1767

@FxKu FxKu closed this May 19, 2022
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.

operator pod panic: send on closed channel during switchover

2 participants