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

added mutex at right places #3678

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

ashutosji
Copy link
Contributor

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it: This PR will resolve concurrent map writes issue.

Which issue(s) this PR fixes: #3670

Closes #3670

Special notes for your reviewer:

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 33c440c1-ecf6-4c03-b214-284132e8ae80

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3678/head:pr_3678 && git checkout pr_3678
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.39.0-dev-646a1af-amd64

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

Do we need to have similar locking here:

Looks like allocCnts has the same issue.

When we get to

for j := 0; j < sc.numOfClients; j++ {
scnAllocCnt += allocCnts[j]
scnFailureCnt += failureCnts[j]
for k, v := range failureDtls[j] {
totalFailureDtls[k] += v
scnErrDtls[k] += v
}

Also wondering if that should be locked?

@ashutosji
Copy link
Contributor Author

Do we need to have similar locking here:

Looks like allocCnts has the same issue.

Yes, We can have the mutex here.

When we get to

for j := 0; j < sc.numOfClients; j++ {
scnAllocCnt += allocCnts[j]
scnFailureCnt += failureCnts[j]
for k, v := range failureDtls[j] {
totalFailureDtls[k] += v
scnErrDtls[k] += v
}

Also wondering if that should be locked?

Ratio of error is very less here. We can have it without mutex, But, However rather than using mutiple mutex i though of utilizing atomic since we are having WaitGroup in place.
WDYT?

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: eb14ceab-8970-44cb-b97d-f10e6cb58357

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3678/head:pr_3678 && git checkout pr_3678
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.39.0-dev-2e83d24-amd64

@markmandel
Copy link
Member

Ratio of error is very less here. We can have it without mutex, But, However rather than using mutiple mutex i though of utilizing atomic since we are having WaitGroup in place.

Clever! I like it.

@markmandel markmandel merged commit 1fcda51 into googleforgames:main Mar 8, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance test occasionally fails with fatal error: concurrent map writes
3 participants