-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes a deadlock that occurs whenever a repository that was imported from another repository with existing pushlogs receives a post receive repository hook. This deadlock occured, because on the event the PushlogManager creates a semaphore based on the id of the repository. After the pushlog has been written, the manager tries to find and unlock this semaphore based on the repository id stored in the pushlog. If the repository is an imported one with a pushlog that has been created beforehand in the original repository, this stored repository id differs from the actual id of the current repository. Therefore the semaphore has not been found and the lock stayed in place. Whenever a second event has been fired for such a repository, the manager cannot pass the semaphore, because it still is locked. This can lead up to a complete block of the core event bus of SCM-Manager so that no asynchronous event whatsoever can be processed any more. This is the case, because the event bus does not call hooks of the same type (in this case the PushlogHook) in parallel. Therefore all further pushlog hooks will have to wait for the event that has been blocked in the first place, which will eventually block all threads of the event bus. To fix this, this commit removes the redundant and error prone repository id from the pushlog and uses the id of the repository the event was triggered for in both places, the lock and the unlock of the semaphore. Because a removed fields are ignored by the xml parser loading the pushlog enties, we do not have to adapt the data in an update step. The repository id (and while we're at it the unused 'dataVersion', too) simply will be omitted whenever the pushlog is changed for a repository the next time.
- Loading branch information
Showing
4 changed files
with
15 additions
and
106 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- type: fixed | ||
description: Block of event bus ([#8](https://github.com/scm-manager/scm-pushlog-plugin/pull/8)) |
This file contains 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
This file contains 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
This file contains 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