Skip to content

[Database] Make the database path unique to the specific lmdb wrapper instance #107

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 2 commits into from
Jul 14, 2020
Merged

[Database] Make the database path unique to the specific lmdb wrapper instance #107

merged 2 commits into from
Jul 14, 2020

Conversation

akyrtzi
Copy link
Contributor

@akyrtzi akyrtzi commented Jul 10, 2020

This is intended to protect against a crash that can occur if trying to use the same lmdb database path from separate wrapper instances.

rdar://39235399

@akyrtzi akyrtzi requested a review from benlangmuir as a code owner July 10, 2020 03:43
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 10, 2020

@swift-ci Please test

2 similar comments
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 10, 2020

@swift-ci Please test

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 10, 2020

@swift-ci Please test

@@ -71,29 +71,39 @@ static int filesForProvider_compare(const MDB_val *a, const MDB_val *b) {
return IDCode::compare(lhs->UnitCode, rhs->UnitCode);
}

/// Returns a global serial queue for unit processing.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, copy-pasted the comment and forgot to update it.

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 10, 2020

I also forgot to re-generate the linux tests 🤦‍♂️

… instance

This is intended to protect against a crash that can occur if trying to use the same lmdb database path from separate wrapper instances.

rdar://39235399
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 10, 2020

@swift-ci Please test

TSan seems to trigger a false positive with this test.
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 14, 2020

@swift-ci Please test

@akyrtzi akyrtzi merged commit 8c593c4 into swiftlang:master Jul 14, 2020
@akyrtzi akyrtzi deleted the mdb_cursor_put_crash branch July 14, 2020 02:53
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.

2 participants