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 data race when calling GetISO3166 #35

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

georgepsarakis
Copy link
Contributor

  • Use parallelization in test cases in order to reproduce the problem and also detect such issues in the future.
  • Enable race detector when running unit tests in Github Actions.
  • Fix the data race by adding a package-level initialization function that populates the ISO3166 configurations on package initialization only.

- Enable race detector when running unit tests in Github Actions.
The data race was triggered when multiple goroutines
tried to access and modify the global variable used for caching ISO3166
per-country configurations.
@dongri dongri merged commit 97a2d6b into dongri:master Oct 4, 2023
1 of 2 checks passed
@dongri
Copy link
Owner

dongri commented Oct 4, 2023

@georgepsarakis Thank you
LGTM

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.

2 participants