Only remove the indexer lock when there is really a stale lock
Previously the rmdir could be executed when the lock directory had been deleted by another indexer already. This could lead to a race condition when another indexer call creates the lock again between the if and the rmdir. This issue still exists for stale lock directories but they normally shouldn't exist. This also prevents the loop from becoming an endless loop when the lock directory can't be created. This change also fixes a syntax error in the indexer and prevents an endless loop when the lock directory exists but can't be deleted.
Please register or sign in to comment