Skip to content

Commit

Permalink
fixes igniterealtime#188: Fix for clustering data consistency issue w…
Browse files Browse the repository at this point in the history
…ith MUC rooms

Since Openfire 4.7.0, a new API is available that ensures that MUC data is synchronized across Openfire cluster nodes. This commit adds support for this API.

As a result, data consistency with regards to MUC-related data (chatrooms, mostly), should improve.

This commit contains two related changes:
- Invocation of `service.syncChatRoom()` after room changes, to ensure that those changes are visible to other cluste nodes.
- Application of room-specific mutexes when rooms are interacted with.

The addition of an additional mutex typically comes with a risk of introducing a deadlock-like scenario. As a mitigation for this, a new property has been introduced that controls if the mutex is engaged when the REST API interacts with MUC rooms.

The property name is `plugin.restapi.muc.room-mutex.enabled` and is enabled by default. To prevent mutex usage, this property can be switced to `false`.
  • Loading branch information
guusdk committed Dec 22, 2023
1 parent 3f64562 commit fa299c0
Show file tree
Hide file tree
Showing 5 changed files with 347 additions and 182 deletions.
5 changes: 5 additions & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ <h1>
REST API Plugin Changelog
</h1>

<p><b>1.10.3</b> (tbd)</p>
<ul>
<li>[<a href='https://github.com/igniterealtime/openfire-restAPI-plugin/issues/188'>#188</a>] - Fix issues with MUC room data consistency in an Openfire cluster</li>
</ul>

<p><b>1.10.2</b> November 20, 2023</p>
<ul>
<li>Added Ukrainian (uk_UA) translation, created and provided by Yurii Savchuk (svais) and his son Vladislav Savchuk (Bruhmozavr)!</li>
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<description>Allows administration over a RESTful API.</description>
<author>Roman Soldatow</author>
<version>${project.version}</version>
<date>2023-11-20</date>
<date>2023-12-22</date>
<minServerVersion>4.7.0</minServerVersion>
<adminconsole>
<tab id="tab-server">
Expand Down
1 change: 1 addition & 0 deletions src/i18n/restapi_i18n.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
system_property.plugin.restapi.muc.case-insensitive-lookup.enabled=Names of MUC rooms should be node-prepped. This, however, was not guaranteed the case in some versions of Openfire and this plugin. Earlier versions of this plugin used a case-insensitive lookup to work around this. As this should be unneeded, and is quite resource intensive, this behavior has been made configurable (disabled by default).
system_property.plugin.restapi.muc.room-mutex.enabled=Controls if a mutual exclusion lock is used when an API interacts with a room.

stat.restapi_responses.informational.name=REST API 1xx responses
stat.restapi_responses.informational.desc=The amount of HTTP responses that had an 'Informational' status (a code in the 1xx range).
Expand Down
1 change: 1 addition & 0 deletions src/i18n/restapi_i18n_nl.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
system_property.plugin.restapi.muc.case-insensitive-lookup.enabled=Namen van MUC-kamers zouden genode-prepped moeten zijn. Dit werd echter niet gegarandeerd in sommige versies van Openfire en deze plugin. Oudere versies van deze plugin gebruikten een hoofdletter-ongevoelige zoekopdracht om hier omheen te werken. Dit vergt behoorlijk wat rekenkracht en zou onnodig moeten zijn. Hierom is dit gedrag configureerbaar gemaakt (standaard-instelling: uit)
system_property.plugin.restapi.muc.room-mutex.enabled=Bepaald of een MUC-kamer-specifieke mutex wordt gebruikt wanneer de API interacteert met een MUC-kamer.

stat.restapi_responses.informational.name=REST API 1xx antwoorden
stat.restapi_responses.informational.desc=Het aantal HTTP antwoorden met een 'Informational' status (een code in de 1xx reeks).
Expand Down
Loading

0 comments on commit fa299c0

Please sign in to comment.