Skip to content

repo-updater: use value instead of pointer for configuredRepo2

Administrator requested to merge core/repo-syncer-coarse-lock into master

Created by: keegancsmith

This prevents any race conditions around us updating the pointers we had to configuredRepo2. Additionally it may reduce garbage we produce in the heap.

Previously we added a coarse lock and adjusted the mutex to an RWMutex. The coarse lock went from holding during an O(n) operation to an O(nlogn). Additionally RWMutex was inappropriate since RLock would only happen very rarely and there would be lots of quick Lock calls. RWMutex is not appropriate for that pattern.

This was done by a bunch of find replaces. The type system should catch any mistakes in the refactoring. Luckily we have extensive test coverage as well.

Follow-up of https://github.com/sourcegraph/sourcegraph/pull/9262 Fixes #9045

Merge request reports

Loading