Skip to content

KS NPE, better exception for #306 #310

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

Merged
merged 1 commit into from
Mar 5, 2020
Merged

Conversation

alesj
Copy link
Contributor

@alesj alesj commented Mar 5, 2020

@alesj alesj requested a review from EricWittmann March 5, 2020 09:57
@alesj
Copy link
Contributor Author

alesj commented Mar 5, 2020

@tombentley I don't see what else can be done in this case ... ?

@@ -104,7 +104,7 @@ public void close() {

protected final S serviceForKey(K key) {
StreamsMetadata smeta = streams.metadataForKey(storeName, key, keySerde.serializer());
if (smeta == StreamsMetadata.NOT_AVAILABLE) {
if (smeta == null || smeta == StreamsMetadata.NOT_AVAILABLE) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null really indicates that there is no matching metadata for the given store and key. Maybe that can be a transient condition (to be honest I don't know, but I'm guessing the store might eventually have that key), or it could indicate a non-transient programming error in your streams application (i.e. you're asking for the wrong key, or the wrong store and it will never become non-null). In any case I think it would be useful to have a distinct exception message, since the NOT_AVAILABLE case is definitely expected to be transient.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will fix this ...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EricWittmann EricWittmann merged commit a8036fc into Apicurio:1.1.x Mar 5, 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

Successfully merging this pull request may close these issues.

3 participants