fixes #122: Avoid potential deadlock when loading plugin#123
Open
guusdk wants to merge 1 commit intoigniterealtime:mainfrom
Open
fixes #122: Avoid potential deadlock when loading plugin#123guusdk wants to merge 1 commit intoigniterealtime:mainfrom
guusdk wants to merge 1 commit intoigniterealtime:mainfrom
Conversation
If this plugin is being loaded when Openfire has already started, avoid initializing `initializeClustering` as part of the plugin initialization. The plugin initialization locks the plugin manager. `initializeClustering` needs to obtain resources from the plugin manager (which it can't get while it's locked). By making the `initializeClustering` method asynchronous, it no longer prevents the plugin initialization from completing, thus breaking the deadlock.
6e2eec2 to
f95c095
Compare
Fishbowler
approved these changes
Feb 18, 2026
| public void pluginsMonitored() { | ||
| manager.removePluginManagerListener(this); | ||
| initializeClustering(pluginDirectory); | ||
| CompletableFuture.runAsync(() -> initializeClustering(pluginDirectory)) ; |
Member
There was a problem hiding this comment.
Given this is already in an async listener, I assume if this threw before and threw now, the effect would be the same? Initialize would still complete, etc?
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.
If this plugin is being loaded when Openfire has already started, avoid initializing
initializeClusteringas part of the plugin initialization.The plugin initialization locks the plugin manager.
initializeClusteringneeds to obtain resources from the plugin manager (which it can't get while it's locked).By making the
initializeClusteringmethod asynchronous, it no longer prevents the plugin initialization from completing, thus breaking the deadlock.