Skip to content
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

We need an exception check here to fail gracefully #3

Open
tylerperyea opened this issue Dec 15, 2020 · 0 comments
Open

We need an exception check here to fail gracefully #3

tylerperyea opened this issue Dec 15, 2020 · 0 comments

Comments

@tylerperyea
Copy link
Collaborator

tylerperyea commented Dec 15, 2020

This can throw an exception if a molfile fails to parse, it shouldn't fail catastrophically when that happens:

out.put(new Result (p, similarity,null));

Also, this can only happen because we parse the molfile as part of the payload loading:

The thing is, we only NEED to parse the molfile if we're going to do a substructure search. For similarity searches this is an unnecessary step anyway and should probably be avoided. Perhaps it can be deferred?

The worse part about this is that throwing an exception ultimately makes the queue wait forever:

for (int i = 0; i < nthreads; ++i)
in.put(POISON_PAYLOAD);
threadPool.submit(new Runnable () {
public void run () {
try {
int total = 0;
for (Future<Integer> f : threads) {
total += f.get();
}
out.put(POISON_RESULT);
}
catch (Exception ex) {
ex.printStackTrace();
}
}
});

Typically we shouldn't see an unparsable molfile in the index, but it does happen from time to time.

dkatzel-ncats added a commit that referenced this issue Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant