Files
gerrit/gerrit-lucene/src
Shawn Pearce fdfc3738fc Write each Lucene index using a dedicated background thread
Backport of I54296d62fd9206b2ed2bbcbd5bbcc941890206a3 to stable-2.12

Like searches, it is not safe to interrupt the IndexWriter.  It also
reads from the NIOFSDirectory which closes file handles if the thread
is interrupted (such as by SSH command being Ctrl-C'd).

Although IndexWriter is thread safe it is essentially single threaded.
Each of these methods acquires a lock on entry, manipulates the index,
and releases the lock. There isn't a lot of value in allowing these to
be running on parallel threads borrowed from Gerrit.

Background (and serialize) all writes onto a single thread to prevent
an interrupt on the application thread from passing into Lucene code.

Change-Id: I2678e1a4c106c027b02fce47d0a570f59f6dde57
2016-09-07 16:38:58 -04:00
..