Lucene.Net.Store.Azure icon indicating copy to clipboard operation
Lucene.Net.Store.Azure copied to clipboard

Multithreading when downloading cache

Open bbieniek opened this issue 3 years ago • 0 comments

Hi,

We use this package in Azure Function. In Azure Function, the host instance is stopped and then restarted every few hours. When the instance is initialized, we would download the blob container content into RAMDirectory. I think that sometimes when the cache is being downloaded and something else also tries to run a request, AzureDirectory will try to download the cache twice. Because of that, we sometimes get random exceptions like:

Cannot parse '"a"': Encountered "<EOF>" at line 1, column 2.
Was expecting one of:
    <NOT> ...
    "+" ...
    "-" ...
    <BAREOPER> ...
    "(" ...
    "*" ...
    <QUOTED> ...
    <TERM> ...
    <PREFIXTERM> ...
    <WILDTERM> ...
    <REGEXPTERM> ...
    "[" ...
    "{" ...
    <NUMBER> ...
    <TERM> ...
    "*" ...
    

What is the best way to use this package in Azure Function and ensure that the usage of the package is thread-safe?

bbieniek avatar Apr 21 '22 07:04 bbieniek