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: race condition when registering grpc types #4297

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abemedia
Copy link

What?

Adds a mutex to avoid race condition when registering proto types.

Why?

When registering proto types we first check if they exist. With multiple tests running concurrently the check could result in false for multiple tests which then simultaneously try to register the type, resulting in the following error:

panic: proto: message XXX is already registered

See the following issue:

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

Closes #3961

@abemedia abemedia requested a review from a team as a code owner January 29, 2025 15:12
@abemedia abemedia requested review from inancgumus and oleiade and removed request for a team January 29, 2025 15:12
@CLAassistant
Copy link

CLAassistant commented Jan 29, 2025

CLA assistant check
All committers have signed the CLA.

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.

gRPC using reflect race on registering types
2 participants