Skip to content

[Collections] testPopulateTargetTrie sometimes gets stuck #3522

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

Merged
merged 4 commits into from
Jun 3, 2021

Conversation

yim-lee
Copy link
Contributor

@yim-lee yim-lee commented Jun 2, 2021

Motivation:
PackageCollectionsStorageTests/testPopulateTargetTrie gets stuck sometimes because targetTrieReady is already set and callback is only invoked in the body of memoize.

https://ci.swift.org/job/oss-swift-package-ubuntu-20_04-aarch64/79/console

Modifications:
Rearrange logic in populateTargetTrie such that callback is invoked outside of memoize body.

Also, add populateTargetTrieLock to prevent more than one thread from calling memoize at the same time.

Motivation:
`PackageCollectionsStorageTests/testPopulateTargetTrie` gets stuck sometimes because `targetTrieReady` is already set and `callback` is only invoked in the body of `memoize`.

https://ci.swift.org/job/oss-swift-package-ubuntu-20_04-aarch64/79/console

Modifications:
Rearrange logic in `populateTargetTrie` such that `callback` is invoked outside of `memoize` body.

Also, add `populateTargetTrieLock` to prevent more than one thread from calling `memoize` at the same time.
@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 2, 2021

@swift-ci please smoke test

Copy link
Contributor

@drexin drexin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you!

@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 2, 2021

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 2, 2021

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 2, 2021

@swift-ci please smoke test

@yim-lee
Copy link
Contributor Author

yim-lee commented Jun 2, 2021

@swift-ci please smoke test macOS

@yim-lee yim-lee merged commit 58fb699 into swiftlang:main Jun 3, 2021
@yim-lee yim-lee deleted the stuck-populateTargetTrie branch June 3, 2021 00:39
yim-lee added a commit to yim-lee/swift-package-manager that referenced this pull request Jun 3, 2021
…3522)

Motivation:
`PackageCollectionsStorageTests/testPopulateTargetTrie` gets stuck sometimes because `targetTrieReady` is already set and `callback` is only invoked in the body of `memoize`.

https://ci.swift.org/job/oss-swift-package-ubuntu-20_04-aarch64/79/console

Modifications:
Rearrange logic in `populateTargetTrie` such that `callback` is invoked outside of `memoize` body.

Also, add `populateTargetTrieLock` to prevent more than one thread from calling `memoize` at the same time.
yim-lee added a commit that referenced this pull request Jun 3, 2021
)

Motivation:
`PackageCollectionsStorageTests/testPopulateTargetTrie` gets stuck sometimes because `targetTrieReady` is already set and `callback` is only invoked in the body of `memoize`.

https://ci.swift.org/job/oss-swift-package-ubuntu-20_04-aarch64/79/console

Modifications:
Rearrange logic in `populateTargetTrie` such that `callback` is invoked outside of `memoize` body.

Also, add `populateTargetTrieLock` to prevent more than one thread from calling `memoize` at the same time.
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.

4 participants