-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[FLINK-37721] Fixes janino bug returning incorrect results #26504
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
Conversation
Could you please fix the PR to meet the community standards? In particular:
You can find contribution guidelines here: https://flink.apache.org/how-to-contribute/code-style-and-quality-pull-requests/ Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR should be good after fixing the PR requirements
// This was the cause of a bug previously where the reference to the sync projection was | ||
// getting garbled by janino. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please link the JIRA issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, added the link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please double check you committed the change. I don't see a JIRA number mentioned in the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake. I included the link this time.
c3f75e8
to
f8339e2
Compare
What is the purpose of the change
The bug comes from the fact that previously, we were creating an anonymous function callback within the janino generated code. This function was then referencing the local
DelegatingAsyncResultFuture
, effectively creating a closure. When the function was called back from different threads, they seemed to both reference the sameDelegatingAsyncResultFuture
rather than their own local ones. The result was returning incorrect "synchronous" results, so queries like the following might have issues:Here, the f1 column returned was retrieved by asking for it from the local
DelegatingAsyncResultFuture
, and so getting the wrong instance meant getting the wrong result.To fix it, I removed the inner anonymous function and just added the same logic on
DelegatingAsyncResultFuture
. It requires setting it up with all of the metadata (indexes, sync results), and when the result is complete, rather than calling the generated function, it just creates the resultRowData
itself.Brief change log
Verifying this change
This change added tests and can be verified as follows:
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)DelegatingAsyncResultFuture
shouldn't differ in any significant way, so should be a no-op.Documentation