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

Fix MemoryMetadata#streamTableColumnNames #16062

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

pettyjamesm
Copy link
Member

Description

Fixes MemoryMetadata#streamTableColumnNames by returning am iterator over a fully materialized collection evaluated fully before returning from the method and releasing the object monitor. The previous implementation returned a lazy iterator over the contents of the tables map which could throw a ConcurrentModificationException if another thread modified the map before the caller fully consumed the iterator.

Additional context and related issues

Run failure: https://github.com/trinodb/trino/actions/runs/4138831198/jobs/7158842747

Release notes

( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text:

# Memory connector
* Fix a race condition failure that could occur when reading table column metadata with concurrent create or drop table DDL operations

The previous implementation returned a lazy iterator over the contents
of the tables map which could throw a ConcurrentModificationException if
another thread modified the map before the caller fully consumed the
iterator. Instead, the iterator returned must be from a fully
materialized collection evaluated fully before returning from the method
and releasing the object monitor.
@cla-bot cla-bot bot added the cla-signed label Feb 10, 2023
@pettyjamesm pettyjamesm added the bug Something isn't working label Feb 10, 2023
@pettyjamesm pettyjamesm requested a review from findepi February 10, 2023 15:43
@raunaqmorarka raunaqmorarka requested a review from ebyhr February 11, 2023 06:20
@ebyhr ebyhr merged commit d1c9d57 into trinodb:master Feb 13, 2023
@github-actions github-actions bot added this to the 407 milestone Feb 13, 2023
@ebyhr ebyhr mentioned this pull request Feb 13, 2023
@pettyjamesm pettyjamesm deleted the fix-memory-metadata branch February 13, 2023 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla-signed
Development

Successfully merging this pull request may close these issues.

2 participants