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

OCPBUGS-5523: Catalog, fatal error: concurrent map read and map write #2913

Merged

Conversation

dtfranz
Copy link
Contributor

@dtfranz dtfranz commented Jan 9, 2023

Protected subscriptionSyncCounters access to prevent concurrent map writes

Description of the change:

The metrics pkg uses a shared map var which is not protected from concurrent read/write access. This PR adds a mutex to lock and unlock before and after each map access instance.

Motivation for the change:

OCPBUGS-5523

…rites

Signed-off-by: Daniel Franz <dfranz@redhat.com>
@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jan 9, 2023
@openshift-ci-robot
Copy link
Collaborator

@dtfranz: This pull request references Jira Issue OCPBUGS-5523, which is invalid:

  • expected the bug to target the "4.13.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Protected subscriptionSyncCounters access to prevent concurrent map writes

Description of the change:

The metrics pkg uses a shared map var which is not protected from concurrent read/write access. This PR adds a mutex to lock and unlock before and after each map access instance.

Motivation for the change:

OCPBUGS-5523

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.

@openshift-ci openshift-ci bot requested review from exdx and grokspawn January 9, 2023 22:55
Signed-off-by: Daniel Franz <dfranz@redhat.com>
@dtfranz dtfranz changed the title OCPBUGS-5523: Catalog, fatal error: concurrent map read and map write Draft: OCPBUGS-5523: Catalog, fatal error: concurrent map read and map write Jan 10, 2023
Signed-off-by: Daniel Franz <dfranz@redhat.com>
@dtfranz
Copy link
Contributor Author

dtfranz commented Jan 11, 2023

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jan 11, 2023
@openshift-ci-robot
Copy link
Collaborator

@dtfranz: This pull request references Jira Issue OCPBUGS-5523, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.13.0) matches configured target version for branch (4.13.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @jianzhangbjz

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

/jira refresh

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.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jan 11, 2023
@dtfranz dtfranz changed the title Draft: OCPBUGS-5523: Catalog, fatal error: concurrent map read and map write OCPBUGS-5523: Catalog, fatal error: concurrent map read and map write Jan 11, 2023
pkg/metrics/metrics.go Outdated Show resolved Hide resolved
pkg/metrics/metrics.go Outdated Show resolved Hide resolved
Signed-off-by: Daniel Franz <dfranz@redhat.com>
Copy link
Member

@awgreene awgreene left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me, could we squash the commits? It'll make it easier for downstreaming.

pkg/metrics/metrics.go Show resolved Hide resolved
pkg/metrics/metrics.go Show resolved Hide resolved
@openshift-ci openshift-ci bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Jan 13, 2023
Copy link
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2023
@awgreene
Copy link
Member

@dtfranz this needs a rebase.

@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 16, 2023
Copy link
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

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

/lgtm

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

openshift-ci bot commented Jan 16, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: awgreene, dtfranz, tmshort

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

@openshift-merge-robot openshift-merge-robot merged commit 2a49a4d into operator-framework:master Jan 16, 2023
@openshift-ci-robot
Copy link
Collaborator

@dtfranz: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-5523 has been moved to the MODIFIED state.

In response to this:

Protected subscriptionSyncCounters access to prevent concurrent map writes

Description of the change:

The metrics pkg uses a shared map var which is not protected from concurrent read/write access. This PR adds a mutex to lock and unlock before and after each map access instance.

Motivation for the change:

OCPBUGS-5523

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.

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants