Skip to content

Conversation

@benlangmuir
Copy link
Contributor

When a document is opened twice without closing it we re-initialize its internal data. Make sure we don't race with code that accesses that data.

This could have broken the unit test EditTest.DiagsAfterReopen. It's unlikely it impacts EditTest.DiagsAfterCloseAndReopen.

Found by TSan!

@benlangmuir
Copy link
Contributor Author

@swift-ci please smoke test

@benlangmuir
Copy link
Contributor Author

@swift-ci please smoke test

I haven't found any cases where this changes the visible behaviour of
the test, but having the file remain open across invocations was
certainly unexpected and affects how the first part of the test works at
runtime.
When a document is opened twice without closing it we re-initialize its
internal data. Make sure we don't race with code that accesses that data.

Found by TSan!
@benlangmuir
Copy link
Contributor Author

@swift-ci please smoke test

@benlangmuir benlangmuir merged commit 314da03 into swiftlang:master Sep 14, 2018
@benlangmuir benlangmuir deleted the edit-test-race branch September 14, 2018 17:56
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.

1 participant