Fix publisher deadlock when workspace child resources are published in commit mode (#838)#841
Open
michelversluijs wants to merge 1 commit intoAzure:v7from
Open
Conversation
…n commit mode When running with COMMIT_ID set and FeatureManagement__Workspaces=true, the publisher would hang silently after 'Running publisher...' with no APIM calls and no error output. Root cause: processDelete cascaded to successors for every resource where isInFileSystem=false, not just resources actually being deleted. WorkspaceResource has no artifact file and is never part of the resource set, so it always entered processDelete. Its cascade logic then awaited the workspace child tasks (e.g. WorkspaceApiResource), which were themselves waiting for the workspace task via the predecessor relationship — a circular wait. Fix: add a guard at the top of processDelete that returns immediately when the resource is not in the resource set. The existing conditional around deleteResource is removed as it is now unreachable when false. Fixes Azure#838
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #838
When running the publisher in commit mode (
COMMIT_IDset) withFeatureManagement__Workspaces=true, the process would hang indefinitelyafter printing "Running publisher..." with no APIM calls and no error output.
Root Cause
processDeletecascaded to child successor tasks for every resource whereisInFileSystem = false, not only resources actually being deleted.WorkspaceResourcehas no artifact file and is never part of the resource set,so it always entered
processDelete. Its cascade logic then awaited workspacechild tasks (e.g.
WorkspaceApiResource), which were themselves waiting forthe workspace task via the predecessor relationship — a circular wait:
WorkspaceApiResource(Task-A) waits for its predecessorWorkspaceResource(Task-B).processDelete, cascades to successors, waits for Task-A.This affects all workspace child resource types and only triggers when
COMMIT_IDis set and the modified file belongs to a workspace artifact that already existed
in the previous commit.
Fix
Add a guard at the top of
processDeletethat returns immediately when theresource is not in the resource set. The existing conditional around
deleteResourceis removed as it is unreachable in that case.Reproduction
workspaces/<ws>/apis/<api>/specification.yaml)COMMIT_ID=<hash>andFeatureManagement__Workspaces=true.