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 for DataTable race-condition crash #3211

Conversation

jamespan
Copy link

@jamespan jamespan commented Aug 31, 2023

This patch fix some race condition crashes not fixed in #1962.

When updating a cell in DataTable with update_width=True, then remove the row, a crash will happen when on_idle run.

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

Copy link
Contributor

@rodrigogiraoserrao rodrigogiraoserrao left a comment

Choose a reason for hiding this comment

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

Hey there, thanks for opening this PR.

I added a small request after a quick look at your changes.
(By the way, thanks for adding a test!)

tests/test_data_table.py Show resolved Hide resolved
@jamespan jamespan force-pushed the bugfix/datatable-remove-row-race-condition branch from dec9103 to 851dc3a Compare September 7, 2023 02:18
@jamespan jamespan force-pushed the bugfix/datatable-remove-row-race-condition branch from 6c1c27d to c41fe53 Compare September 7, 2023 02:23
@willmcgugan
Copy link
Collaborator

@darrenburns Your call on this one...

@darrenburns
Copy link
Member

I wonder if adding the following to remove_row is all that's needed here.

        for column_key in self._data.get(row_key):
            self._updated_cells.discard(CellKey(row_key, column_key))

This ensures that when we remove a row, then any cells that were contained within that row and awaiting a new width calculation are discarded before on_idle comes around.

@willmcgugan willmcgugan mentioned this pull request Oct 5, 2023
@willmcgugan
Copy link
Collaborator

I think we are going to go with an alternative solution. Thanks for bringing this to our attention @jamespan

@willmcgugan willmcgugan closed this Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants