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

fix(clustering): race cond for new DP and new cfg #9616

Merged
merged 5 commits into from
Oct 26, 2022
Merged

Conversation

StarlightIbuki
Copy link
Contributor

@StarlightIbuki StarlightIbuki commented Oct 26, 2022

  1. When new DP connects, it first pushes config, then adds the DP to client lists;
  2. When the client list is empty, push_config_loop skips handling of the new config signal, expect the config to be sent by logic no.1

This causes races when a new config comes in while the first DP is receiving its first config, and the config will be skipped as the list is empty. The new config won't be seen by that DP or any new DPs.

We fix that by re-posting the semaphore, so no config will be missed.

Co-authored-by: @flrgh for his diagnosis(don't forget to add this to the commit message)

fix FT-3496

kong/clustering/control_plane.lua Outdated Show resolved Hide resolved
kong/clustering/wrpc_control_plane.lua Outdated Show resolved Hide resolved
@StarlightIbuki StarlightIbuki requested a review from flrgh October 26, 2022 09:38
Copy link
Contributor

@flrgh flrgh left a comment

Choose a reason for hiding this comment

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

👍 LGTM, thanks @StarlightIbuki! I have tested locally and can no longer reproduce the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants