MarginaliaSearch/code/services-core
Viktor Lofgren f15dd06473 (index) Delayed close() of SearchIndexReader
This avoids concurrent access errors.  This is especially important when using Unsafe-based LongArrays, since we have concurrent access to the underlying memory-mapped file.  If pull the rug from under the caller by closing the file, we'll get a SIGSEGV.  Even with a "safe" MemorySegment, we'll get ugly stacktraces if we close the file while a thread is still accessing it.

So we spin up a thread that sleeps for a minute before actually unmapping the file, allowing any ongoing requests to wrap up.  This is 100% a hack, but it lets us get away with doing this without adding locks to the index readers.

Since this is "just" mmapped data, and this operation happens optimistically once a month, it should be safe if the call gets lost.
2024-01-23 11:08:41 +01:00
..
assistant-service (*) install script for deploying Marginalia outside the codebase 2024-01-11 12:40:03 +01:00
control-service (converter) Update Stackexchange sideload instruction 2024-01-22 18:29:20 +01:00
executor-service (actor) Try to rare data race where a finished job is considered dead. 2024-01-22 21:22:38 +01:00
index-service (index) Delayed close() of SearchIndexReader 2024-01-23 11:08:41 +01:00
query-service (query-api) Make the search set identifier a string value in the API 2024-01-16 10:55:24 +01:00
readme.md (refactor) Move search service into services-satellite 2023-10-09 13:40:01 +02:00

Core Services

The cores services constitute the main functionality of the search engine, relatively agnostic to the Marginalia application.

  • The index-service contains the indexes, it answers questions about which documents contain which terms.

  • The query-service Interprets queries and delegates work to index-service.

  • The control-service provides an operator's user interface, and is responsible for orchestrating the various processes of the system.

  • The assistant-service helps the search service with spelling suggestions other peripheral functionality.