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

stop downloading the app asynchronously #132

Merged
merged 5 commits into from
Sep 25, 2018

Conversation

jcarrothers-sap
Copy link
Collaborator

Fixes #88

jcarrothers-sap and others added 5 commits April 6, 2018 13:25
The problem is that the schema.ResourceData is not thread safe, even
for concurrent reads, due to internal memoization during reads.  The
result was that app creation would sometimes fail mysteriously with an
"unexpected EOF" error due to the provider process crashing due to
either concurrent map writes or read/write.
Conflicts:
	cloudfoundry/resource_cf_app.go
If the PR is not applied, after running this test many times, it should crash with this error
=== RUN   TestAccApp_reproduceIssue88
Application downloaded to: ../tests/cf-acceptance-tests/assets/java-spring/
Application downloaded to: ../tests/cf-acceptance-tests/assets/java-spring/
fatal error: concurrent map read and map write

goroutine 1542 [running]:
...
created by github.com/terraform-providers/terraform-provider-cf/cloudfoundry.resourceAppCreate
.../golang/src/github.com/terraform-providers/terraform-provider-cf/cloudfoundry/resource_cf_app.go:421 +0x1ac4

# Conflicts:
#	cloudfoundry/resource_cf_app_test.go
Conflicts:
	cloudfoundry/resource_cf_app.go
@jcarrothers-sap
Copy link
Collaborator Author

This PR replaces #103

@janosbinder
Copy link
Collaborator

This was an ugly bug, which this PR fixes. We have deployed it internally and helped us. My tests takes longs to run, so I have nothing against, if we exclude it later. I wanted to provide the tests as a proof-of-concept to reproduce the bug.

@jcarrothers-sap jcarrothers-sap merged commit a5bd054 into dev Sep 25, 2018
@jcarrothers-sap jcarrothers-sap deleted the upstream.fixProviderCrash branch September 25, 2018 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants