Skip to content

Fix incorrect double-checked-locking around TestStreamScanSql#tEnv - #10605

Merged
amogh-jahagirdar merged 1 commit into
apache:mainfrom
tlm365:double-check-locking
Jun 29, 2024
Merged

amogh-jahagirdar merged 1 commit into
apache:mainfrom
tlm365:double-check-locking

Conversation

@tlm365

@tlm365 tlm365 commented Jun 29, 2024

Copy link
Copy Markdown
Contributor

Resolves #10592.

@github-actions github-actions Bot added the flink label Jun 29, 2024

@amogh-jahagirdar amogh-jahagirdar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing @tlm365 and thank you for reporting @snazy ! I'll hold off on merging in case @snazy had comments.

private volatile TableEnvironment tEnv;

@Override
protected TableEnvironment getTableEnv() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not strictly required for correctness, more of a minor performance improvement but you can add a temporary variable in getTableEnv() referencing tEnv since in most cases tEnv will already be initialized. See https://stackoverflow.com/a/3580658

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@amogh-jahagirdar thanks for reviewing and nice ref link. I've updated it.

@tlm365
tlm365 force-pushed the double-check-locking branch from d1c68da to c46d254 Compare June 29, 2024 04:25

@snazy snazy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't this also need to be changed for older Flink versions?

@tlm365
tlm365 force-pushed the double-check-locking branch from c46d254 to cdd94c7 Compare June 29, 2024 07:07
@tlm365

tlm365 commented Jun 29, 2024

Copy link
Copy Markdown
Contributor Author

Doesn't this also need to be changed for older Flink versions?

@snazy Oops, thanks for your review, I missed it. It's updated now.

@amogh-jahagirdar

amogh-jahagirdar commented Jun 29, 2024 •

Copy link
Copy Markdown
Contributor

Doesn't this also need to be changed for older Flink versions?

@snazy Just FYI for future PRs, typically we backport fixes to older engine versions in separate PRs but since this is a small change we can probably just do it in the same PR.

@amogh-jahagirdar

Copy link
Copy Markdown
Contributor

Thanks @tlm365 and @snazy for reviewing!

@amogh-jahagirdar
amogh-jahagirdar merged commit 2bdae5e into apache:main Jun 29, 2024
jasonf20 pushed a commit to jasonf20/iceberg that referenced this pull request Aug 4, 2024
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect double-checked-locking around o.a.i.flink.source.TestStreamScanSql#tEnv

3 participants