Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LuceneSearcher + multiprocessing problem #1761

Closed
davidoterof opened this issue Jan 5, 2024 · 0 comments
Closed

LuceneSearcher + multiprocessing problem #1761

davidoterof opened this issue Jan 5, 2024 · 0 comments

Comments

@davidoterof
Copy link

Hi,

I'm using LuceneSearcher in a multiprocessing setting, but it is not working as I expected. I crafted the following script to showcase the problem that I have:

from multiprocessing import Process
from pyserini.search.lucene import LuceneSearcher


def do_job(w):
    searcher = LuceneSearcher("...")
    print(w)
    print(searcher.doc(w).contents())
    searcher.close()

processes = []

# creating processes
for w in range(4):
    p = Process(target=do_job, args=(w,))
    processes.append(p)
    p.start()

# completing process
for p in processes:
    p.join()

When running this, it gives a bunch of errors like this:

jnius.JavaException: JVM exception occurred: org/apache/lucene/store/Lock java.lang.NoClassDefFoundError

And every time that I run it, the class name changes without any apparent pattern. I don't know if I'm misunderstanding something, and this is normal behaviour, or the problem is on pyserini's side.

thanks

@castorini castorini locked and limited conversation to collaborators Jan 14, 2024
@lintool lintool converted this issue into discussion #1766 Jan 14, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant