Skip to content

Commit

Permalink
ExportObject PUBLISHING State Change Bug (#4835)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbauernfeind authored Nov 15, 2023
1 parent 9e9eb22 commit 2096785
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,11 @@ private synchronized void setWork(
this.errorHandler = errorHandler;
this.successHandler = successHandler;

setState(ExportNotification.State.PENDING);
if (state != ExportNotification.State.PUBLISHING) {
setState(ExportNotification.State.PENDING);
} else if (dependentCount > 0) {
throw new IllegalStateException("published exports cannot have dependencies");
}
if (dependentCount <= 0) {
dependentCount = 0;
scheduleExport();
Expand Down Expand Up @@ -920,7 +924,7 @@ private void onResolveOne(@Nullable final ExportObject<?> parent) {
*/
private void scheduleExport() {
synchronized (this) {
if (state != ExportNotification.State.PENDING) {
if (state != ExportNotification.State.PENDING && state != ExportNotification.State.PUBLISHING) {
return;
}
setState(ExportNotification.State.QUEUED);
Expand Down

0 comments on commit 2096785

Please sign in to comment.