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: concurrent map read and map write caused by reloading in ks-apiserver #5457

Merged
merged 1 commit into from Jan 12, 2023

Conversation

hongzhouzi
Copy link
Member

@hongzhouzi hongzhouzi commented Jan 12, 2023

Signed-off-by: hongzhouzi hongzhouzi@kubesphere.io

What type of PR is this?

/kind bug

What this PR does / why we need it:

ks-apiserver may fail when reloading multiple times in a short period of time, because it is possibility of concurrent map read and map write within the AddToScheme operation.
image

Which issue(s) this PR fixes:

Fixes # #5148

Special notes for reviewers:

The configuration file has changed, but Scheme does not need to be reloaded, so here we use the singleton pattern to solve this problem.

Does this PR introduced a user-facing change?

None

Additional documentation, usage docs, etc.:


@ks-ci-bot ks-ci-bot added kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. release-note-none and removed do-not-merge/release-note-label-needed labels Jan 12, 2023
@hongzhouzi
Copy link
Member Author

/cc @wansir @iawia002

…erver.

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
@hongzhouzi
Copy link
Member Author

/retest

@wansir
Copy link
Member

wansir commented Jan 12, 2023

/lgtm
/approve

/cherry-pick release-3.3

@ks-ci-bot
Copy link
Collaborator

@wansir: once the present PR merges, I will cherry-pick it on top of release-3.3 in a new PR and assign it to you.

In response to this:

/lgtm
/approve

/cherry-pick release-3.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ks-ci-bot ks-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2023
@ks-ci-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: 1edabd7737513ce6f744abd63e11b9f5c188a9dd

@ks-ci-bot ks-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 12, 2023
@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hongzhouzi, wansir

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ks-ci-bot
Copy link
Collaborator

@wansir: new pull request created: #5464

In response to this:

/lgtm
/approve

/cherry-pick release-3.3

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

sologgfun pushed a commit to sologgfun/kubesphere that referenced this pull request Apr 24, 2023
…erver (kubesphere#5457)

fix: concurrent map read and map write caused by reloading in ks-apiserver.

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
wanjunlei pushed a commit to wanjunlei/kubesphere that referenced this pull request Aug 11, 2023
…erver (kubesphere#5457)

fix: concurrent map read and map write caused by reloading in ks-apiserver.

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>

Signed-off-by: hongzhouzi <hongzhouzi@kubesphere.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-none size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants