[HOT FIX] Check for null before deserializing in MeteredSessionStore #6575
Merged
bbejeck merged 3 commits intoapache:trunkfrom Apr 17, 2019
Merged
[HOT FIX] Check for null before deserializing in MeteredSessionStore #6575bbejeck merged 3 commits intoapache:trunkfrom
bbejeck merged 3 commits intoapache:trunkfrom
Conversation
Member
Author
cadonna
approved these changes
Apr 12, 2019
bbejeck
approved these changes
Apr 12, 2019
Member
|
@ableegoldman failure is related |
Member
Author
|
Whoops, thanks spotBugs |
3 tasks
guozhangwang
approved these changes
Apr 13, 2019
Member
|
@ableegoldman failures seem related |
Member
|
Java 8 passed Java 11 failed with known flaky test retest this please |
Member
|
Java 8 failed with known flaky test retest this please |
Member
|
Both Java 8 and Java 11 failed; test results already cleaned up. retest this please |
Member
|
Merged #6575 into trunk |
pengxiaolong
pushed a commit
to pengxiaolong/kafka
that referenced
this pull request
Jun 14, 2019
…pache#6575) The fetchSession() method of SessionStore searches for a (single) specific session and returns null if none are found. This is analogous to fetch(key, time) in WindowStore or get(key) in KeyValueStore. MeteredWindowStore and MeteredKeyValueStore both check for a null result before attempting to deserialize, however MeteredSessionStore just blindly deserializes and as a result NPE is thrown when we search for a record that does not exist. Reviewers: Guozhang Wang <wangguoz@gmail.com>, Bill Bejeck <bbejeck@gmail.com>, Bruno Cadonna <bruno@confluent.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fetchSession() method of SessionStore searches for a (single) specific session and returns null if none are found. This is analogous to fetch(key, time) in WindowStore or get(key) in KeyValueStore. MeteredWindowStore and MeteredKeyValueStore both check for a null result before attempting to deserialize, however MeteredSessionStore just blindly deserializes and as a result NPE is thrown when we search for a record that does not exist.
Also piggyback on this: fetch() in the Metered layer currently delegates to findSessions with time range [0, Long.MAX_VALUE]. It should instead call the wrapped store's fetch directly (which may then delegate to findSessions or not)
Committer Checklist (excluded from commit message)