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

Handle concurrent table drop in TableCommentSystemTable #8443

Merged
merged 1 commit into from
Jul 1, 2021

Conversation

raunaqmorarka
Copy link
Member

Possible fix for #8410

@cla-bot cla-bot bot added the cla-signed label Jul 1, 2021
@@ -152,6 +152,10 @@ public RecordCursor cursor(ConnectorTransactionHandle transactionHandle, Connect
return metadata.getRedirectionAwareTableHandle(session, tableName).getTableHandle()
.map(handle -> metadata.getTableMetadata(session, handle))
.map(metadata -> metadata.getMetadata().getComment())
.get();
.orElseGet(() -> {
// A previously listed table might have been dropped concurrently
Copy link
Member

Choose a reason for hiding this comment

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

getComment is already wrapped in try catch, why we need this?

Copy link
Member Author

Choose a reason for hiding this comment

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

That catches TrinoException, the Optional.get call throws RuntimeException when it is empty

@sopel39 sopel39 merged commit 922aac8 into trinodb:master Jul 1, 2021
@sopel39 sopel39 mentioned this pull request Jul 1, 2021
13 tasks
@raunaqmorarka raunaqmorarka deleted the flaky-fix branch July 2, 2021 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants