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

BaseArrayBackedInputTable user safety fixes #5588

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -306,18 +306,23 @@ private void checkBlockingEditSafety() {
if (updateGraph.currentThreadProcessesUpdates()) {
throw new UnsupportedOperationException("Attempted to make a blocking input table edit from a listener "
+ "or notification. This is unsupported, because it will block the update graph from making "
+ "progress.");
+ "progress and hang indefinitely.");
}
if (updateGraph.sharedLock().isHeldByCurrentThread()) {
throw new UnsupportedOperationException("Attempted to make a blocking input table edit while holding "
+ "the update graph's shared lock. This is unsupported, because it will block the update graph "
+ "from making progress and hang indefinitely.");
}
}

private void checkAsyncEditSafety(@NotNull final Table changeData) {
if (changeData.isRefreshing()
&& updateGraph.currentThreadProcessesUpdates()
&& !changeData.satisfied(updateGraph.clock().currentStep())) {
&& changeData.getUpdateGraph().currentThreadProcessesUpdates()
&& !changeData.satisfied(changeData.getUpdateGraph().clock().currentStep())) {
throw new UnsupportedOperationException("Attempted to make an asynchronous input table edit from a "
+ "listener or notification before the change data table is satisfied on the current cycle. "
+ "This is unsupported, because it may block the update graph from making progress or produce "
+ "inconsistent results.");
+ "listener or notification before the table of data to add or delete is satisfied on the "
+ "current cycle. This is unsupported, because it may block the update graph from making "
+ "progress or produce inconsistent results.");
}
}

Expand Down
Loading