The semantics of indexer concurrency and the constraints on its usage should be well-defined and documented.
Indexer transaction (Batch) objects are currently not thread-safe, so all writes are synchronized with mutexes. If this has a performance impact, we could
guarantee Batch can be used concurrently and remove redundant locks, or
refactor so a Tx object of some kind can be used for each thread
The semantics of indexer concurrency and the constraints on its usage should be well-defined and documented.
Indexer transaction (`Batch`) objects are currently not thread-safe, so all writes are synchronized with mutexes. If this has a performance impact, we could
1. guarantee `Batch` can be used concurrently and remove redundant locks, or
2. refactor so a `Tx` object of some kind can be used for each thread
What is the performance impact of the current locking scheme? As long as the current scheme is enforcing correct behavior, I would be hesitant to replace it unless it was demonstrated to be an actual bottleneck.
I would probably begin by improving logging around lock contention, showing the count of how many threads/routines were waiting for the lock, how long they had to wait, etc.
That work would be needed anyway to demonstrate any improvement offered by a new scheme; or it may show that this is not currently a bottleneck.
What is the performance impact of the current locking scheme? As long as the current scheme is enforcing correct behavior, I would be hesitant to replace it unless it was demonstrated to be an actual bottleneck.
I would probably begin by improving logging around lock contention, showing the count of how many threads/routines were waiting for the lock, how long they had to wait, etc.
That work would be needed anyway to demonstrate any improvement offered by a new scheme; or it may show that this is not currently a bottleneck.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The semantics of indexer concurrency and the constraints on its usage should be well-defined and documented.
Indexer transaction (
Batch) objects are currently not thread-safe, so all writes are synchronized with mutexes. If this has a performance impact, we couldBatchcan be used concurrently and remove redundant locks, orTxobject of some kind can be used for each threadWhat is the performance impact of the current locking scheme? As long as the current scheme is enforcing correct behavior, I would be hesitant to replace it unless it was demonstrated to be an actual bottleneck.
I would probably begin by improving logging around lock contention, showing the count of how many threads/routines were waiting for the lock, how long they had to wait, etc.
That work would be needed anyway to demonstrate any improvement offered by a new scheme; or it may show that this is not currently a bottleneck.
Good point, we can repurpose this as a "review" issue.
Improve concurrency semanticsto Review concurrency semanticsReview concurrency semanticsto Review and document concurrency semantics