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

provider/scaleway: work around API concurrency issue #12707

Merged
merged 1 commit into from
Mar 15, 2017

Conversation

nicolai86
Copy link
Contributor

@nicolai86 nicolai86 commented Mar 14, 2017

when creating IPs concurrently the Scaleway API starts to return 500 internal
server errors.

since the error goes away when limiting concurrent requests, as well as the fact that the golang net/http client is safe for concurrent use,
I'm assuming this is an API error on Scaleways side.

this CS introduces a workaround so terraform does not crash.
the work around needs to be removed once Scaleway fixes their API

I've added a test case which reproduces the error mentioned in #12608:

make testacc TEST=./builtin/providers/scaleway TESTARGS='-run=TestAccScalewayIP_Count'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/14 22:24:15 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/scaleway -v -run=TestAccScalewayIP_Count -timeout 120m
=== RUN   TestAccScalewayIP_Count
--- FAIL: TestAccScalewayIP_Count (2.73s)
    testing.go:268: Step 0 error: Error applying: 1 error(s) occurred:

        * scaleway_ip.base[1]: 1 error(s) occurred:

        * scaleway_ip.base.1: {"message": "Internal error", "type": "server_error"}
FAIL
exit status 1
FAIL    github.com/hashicorp/terraform/builtin/providers/scaleway    2.742s

and the mutex fixes this:

make testacc TEST=./builtin/providers/scaleway TESTARGS='-run=TestAccScalewayIP_Count'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/03/14 22:34:56 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/scaleway -v -run=TestAccScalewayIP_Count -timeout 120m
=== RUN   TestAccScalewayIP_Count
--- PASS: TestAccScalewayIP_Count (5.17s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/scaleway    5.182s

when creating IPs concurrently the Scaleway API starts to return 500 internal
server errors.

since the error goes away when limiting concurrent requests, as well as the fact that the golang net/http client is safe for concurrent use,
I'm assuming this is an API error on Scaleways side.

this CS introduces a workaround so terraform does not crash for now.
the work around needs to be removed once Scaleway fixes their API
@nicolai86
Copy link
Contributor Author

\cc @stack72 not what I was looking for, but I'd choose stability over performance while the issue is under investigation.

@stack72
Copy link
Contributor

stack72 commented Mar 15, 2017

LGTM! you rock @nicolai86 :)

@stack72 stack72 merged commit fcaafee into master Mar 15, 2017
@stack72 stack72 deleted the provider/scaleway-limit-ip-concurrency branch March 15, 2017 14:23
stack72 pushed a commit that referenced this pull request Mar 15, 2017
when creating IPs concurrently the Scaleway API starts to return 500 internal
server errors.

since the error goes away when limiting concurrent requests, as well as the fact that the golang net/http client is safe for concurrent use,
I'm assuming this is an API error on Scaleways side.

this CS introduces a workaround so terraform does not crash for now.
the work around needs to be removed once Scaleway fixes their API
@ghost
Copy link

ghost commented Apr 15, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants