-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
The documentation for multithreading states that Sessions are allowed to be shared across threads, as long as access is synchronized so that the same handle isn't being operated on by more than one thread at a time. This seems like a useful semantic, so I tried creating a cache for sessions and it is working, except that when I close the session handles at the end of the program, it segfaults instead of closing gracefully. The attached file is a minimal test case that simply creates two sessions and then closes them in the main thread with connection.close().
I don't fully understand what is going on, but based on googling around, it sounds like the problem is that the JNIEnv is specific to a single thread. The swig binding uses the JNIEnv of the thread that created the Session to close it - I think instead it must be the JNIEnv of the current thread that is doing the close.
- is depended on by
-
SERVER-19282 WiredTiger changes in MongoDB 3.1.6
- Closed