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 race condition in DirectExchangeClient #11088

Conversation

arhimondr
Copy link
Contributor

Description

A race condition can occur when the client is closed while still being
active (e.g.: early termination due to LIMIT). It may happen that the
memory context is updated after close and then never set back to 0.

Is this change a fix, improvement, new feature, refactoring, or other?

Bug

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

Core

How would you describe this change to a non-technical end user or system administrator?

Users may see queries retaining memory after completion

Related issues, pull requests, and links

#11030

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

( ) No release notes entries required.
(x) Release notes entries required with the following suggested text:

# Trino Core
* Fix problem when memory wasn't always released after query completion

@cla-bot cla-bot bot added the cla-signed label Feb 17, 2022
@arhimondr arhimondr requested a review from losipiuk February 17, 2022 16:50
@arhimondr arhimondr force-pushed the memory-account-race-condition-exchange-client branch from d1b9182 to 0e86ca1 Compare February 17, 2022 17:24
@arhimondr
Copy link
Contributor Author

Updated

A race condition can occur when the client is closed while still being
active (e.g.: early termination due to LIMIT). It may happen that the
memory context is updated after close and then never set back to 0.
@arhimondr arhimondr force-pushed the memory-account-race-condition-exchange-client branch from 0e86ca1 to 6ffc89f Compare February 17, 2022 18:43
@losipiuk losipiuk merged commit 5832a59 into trinodb:master Feb 18, 2022
@github-actions github-actions bot added this to the 372 milestone Feb 18, 2022
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