[MONGOCRYPT-526] csfle lib_create() failed: Cannot initialize the Mongo Crypt Shared Support Library when it is already initialized Created: 30/Jan/23 Updated: 28/Oct/23 Resolved: 05/May/23 |
|
| Status: | Closed |
| Project: | Libmongocrypt |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.7.5 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Shane Harvey | Assignee: | Kyle Kloberdanz |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Binding Changes: | Not Needed | ||||||||||||
| Description |
|
Both rust and python are seeing occasional csfle lib_create() failed: Cannot initialize the Mongo Crypt Shared Support Library when it is already initialized. [Error 3, code 1] errors when testing crypt_shared: PYTHON-3559 and abraham.egnor@mongodb.com was able to remove this error by putting a global mutex around mongocrypt_init and mongocrypt_destroy (here https://github.com/mongodb/libmongocrypt-rust/pull/20/files) which indicates this is a race condition in libmongocrypt itself. Here's an example:
|
| Comments |
| Comment by Githook User [ 09/May/23 ] |
|
Author: {'name': 'Kyle Kloberdanz', 'email': 'kyle.kloberdanz@mongodb.com', 'username': 'kkloberdanz'}Message: Fix Race Condition (#637) Related: Fix race condition by moving critical section into the mutex protected scope. See the following repo for a tool to test the race condition fixed in this PR: https://github.com/kkloberdanz/libmongocrypt_stresstest |
| Comment by Githook User [ 05/May/23 ] |
|
Author: {'name': 'Kyle Kloberdanz', 'email': 'kyle.kloberdanz@mongodb.com', 'username': 'kkloberdanz'}Message: Fix Race Condition (#637) Related: Fix race condition by moving critical section into the mutex protected scope. See the following repo for a tool to test the race condition fixed in this PR: https://github.com/kkloberdanz/libmongocrypt_stresstest |
| Comment by Kyle Kloberdanz [ 05/May/23 ] |
|
I believe the PR above will fix this issue. Shout out to erwin.pe@mongodb.com for help debugging this! |
| Comment by Githook User [ 05/May/23 ] |
|
Author: {'name': 'Kyle Kloberdanz', 'email': 'kyle.kloberdanz@mongodb.com', 'username': 'kkloberdanz'}Message: Fix Race Condition (#637) Related: Fix race condition by moving critical section into the mutex protected scope. See the following repo for a tool to test the race condition fixed in this PR: https://github.com/kkloberdanz/libmongocrypt_stresstest |