-
Type: Task
-
Resolution: Done
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
If a thread is updating its session flags, this code in __lsm_tree_close can race and fail to set the WT_SESSION_SCHEMA_LOCKED flag, so the thread blocks forever instead of completing its operations.
Consider either switching to atomic flags, or (better) adding a field to the session structure that can be set and cleared atomically for this case (and checked inside WT_WITH_SCHEMA_LOCK).
/* * Signal all threads to wake them up, then wait for them to * exit. * * !!! * If we have the schema lock, have the LSM worker sessions * inherit the flag before we do anything. The thread may * already be waiting for the schema lock, but the loop in the * WT_WITH_SCHEMA_LOCK macro takes care of that. */ if (F_ISSET(S2C(session), WT_CONN_LSM_MERGE)) for (i = 0; i < lsm_tree->merge_threads; i++) { F_SET(lsm_tree->worker_sessions[i], F_ISSET(session, WT_SESSION_SCHEMA_LOCKED));