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

Fix NPE with unresponsive Weaviate server #86

Merged
merged 2 commits into from
May 10, 2023
Merged

Conversation

samos123
Copy link
Contributor

@samos123 samos123 commented May 9, 2023

An unresponsive weaviate server will cause a NPE when calling result.getResult. This PR adds a check to see if result.getResult == null and if so retry and if retries are 0 then throw a Weaviate specific exception with error message from Weaviate.

This fixes #85

An unresponsive weaviate server will cause a NPE and the unit test
added here reproduces that NPE.
The weaviate client will ocasionally return null when calling
result.getResult. This can happen when the Weaviate server is not
accessible or when the Weaviate server is overloaded and not able to
return a response temporarily.
@samos123 samos123 requested a review from antas-marcin May 9, 2023 16:36
@weaviate-git-bot
Copy link

Great to see you again! Thanks for the contribution.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Slack channel?

@samos123
Copy link
Contributor Author

Confirmed with end-user in #85 that this PR indeed solves their specific NPE and now throws an informative error message. The error message of the end-user now shows a timeout like this:

io.weaviate.spark.WeaviateResultError: error getting result and no more retries left. Error from Weaviate: [WeaviateErrorMessage(message=Read timed out, throwable=java.net.SocketTimeoutException: Read timed out),

@samos123 samos123 merged commit 73f0874 into weaviate:main May 10, 2023
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

Successfully merging this pull request may close these issues.

Getting a java.lang.NullPointerException error, which is not very informative
3 participants