akshaykarle / terraform-provider-mongodbatlas

Terraform provider for MongoDB Atlas
Mozilla Public License 2.0
122 stars 54 forks source link

Fix for IP Whitelist errors (suspected API race condition) - #31 #33

Closed mmindenhall closed 6 years ago

mmindenhall commented 6 years ago

I suspect the problem here is with the Atlas API, not the provider. Using a mutex in the provider resolved the issue.

codecov-io commented 6 years ago

Codecov Report

Merging #33 into master will decrease coverage by 0.09%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #33     +/-   ##
=========================================
- Coverage   45.56%   45.46%   -0.1%     
=========================================
  Files          10       10             
  Lines         935      937      +2     
=========================================
  Hits          426      426             
- Misses        509      511      +2
Impacted Files Coverage Δ
mongodbatlas/resource_mongodbatlas_ip_whitelist.go 38.04% <0%> (-0.85%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dbf70ae...742a1e1. Read the comment docs.

akshaykarle commented 6 years ago

Interesting issue. I will merge this in if you say it resolves the problem but not sure how it did the mutex helped. Thank you for the PR

akshaykarle commented 6 years ago

closes #33

mmindenhall commented 6 years ago

I think the actual race condition is in the Atlas API implementation. Using a mutex here simply serializes the API requests to avoid the race condition.

mmindenhall commented 6 years ago

BTW I opened an issue in MongoDB's JIRA.