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 TableViewportSubscription race condition #3252

Merged
merged 3 commits into from
Jan 3, 2023

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Dec 29, 2022

Race condition occurs when subscription.close() is called before the subscription has copied the original table. You can reproduce this in a JS API page in the developer console by doing a setInterval, e.g.:

setInterval(() => {
    var subscription = table.setViewport(0, 10)
    subscription.close()
    console.log('table size', table.size)
}, 50)

- Race condition was causing UI error with selectDistinct
- TableViewportSubscription could initialize after it had already been closed
- Check the status to see if we're already DONE before initializing
- Fixes deephaven#3251
@mofojed mofojed added bug Something isn't working NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. labels Dec 29, 2022
@mofojed mofojed added this to the Dec 2022 milestone Dec 29, 2022
@mofojed mofojed self-assigned this Dec 29, 2022
Copy link
Member

@devinrsmith devinrsmith left a comment

Choose a reason for hiding this comment

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

I think @niloc132 should review this.

- Need to still close the table, as that copy promise now never resolves
- Only put the check on the inner lambda, no need to do it twice
@mofojed mofojed merged commit 8d1e790 into deephaven:main Jan 3, 2023
@mofojed mofojed deleted the 3251-select-distinct-error branch January 3, 2023 17:39
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using the Web GUI's "Select Distinct" function results in an error.
3 participants