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

Fixes a bug that prevented seeking to a span created from a different reader in a stream with a large number of symbols. #842

Merged
merged 1 commit into from
May 8, 2024

Conversation

tgregg
Copy link
Contributor

@tgregg tgregg commented May 8, 2024

Description of changes:

Before this fix, the code assumed the following, which was included in a comment:

// Note: because symbols only grows, snapshot.listView will always fit within symbols.

This was valid as long as the same reader that produced a span would always be hoisted to that span. However, the SeekableReader facet allows different readers to share spans as long as they are reading the same stream. When this is the case, the constraint asserted by the comment no longer holds: the reader that produced the span may have progressed far enough in the stream to encounter more symbols than would fit in the other reader's symbols array. In that case, before this fix, an ArrayIndexOutOfBoundsException would be thrown. After this fix, the reader that is hoisted to the span will grow its symbols array if necessary so that it can fit the symbols that are in scope at the span's destination location.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

… reader in a stream with a large number of symbols.
@tgregg tgregg merged commit 77e3b78 into master May 8, 2024
12 of 13 checks passed
@tgregg tgregg deleted the fix-seek-from-different-reader branch May 8, 2024 21:19
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