rstudio/rstudio — comment on commit 65b6b99362a538bd5aa691423b7d7bf3fe67e274
File: src/cpp/session/SessionSourceDatabaseSupervisor.cpp line 371
By jcheng5:

Think there might be a race condition here if a session is being cleaned up (which could potentially take a little while, right?). This falls along the lines of what we discussed earlier today. Each session can be in a state of "locked" (in use), "unlocked" (crashed), or "no lock file" (being reaped) (the latter not being implemented yet). If we move to that model we need to modify lines 366-375, specifically (sessionDirs.size() == 0) needs to change to "are there zero locked sessions" and it needs to come after the reclaim orphan attempt.