Confirmed Several XenForo creator and editor services leaves a transactions open after a save fails

Painbaker

Well-known member
Licensed customer
Affected version
2.3.14
Several XenForo services open a database transaction and commit on success. If a save throws, the service propagates the exception and leaves its transaction open. If the caller already had a transaction, the service leaves its savepoint open. The caller’s next rollback() then rolls back the service’s savepoint while leaving the caller’s transaction active.

Reproduction:
Make the entity being saved read-only, invoke the service’s save routine, and catch the resulting exception. Without an outer transaction, inTransaction() still returns true. With an outer transaction, it still returns true after the caller calls rollback() once.

Native failure path that requires no injected save error:
If Conversation\ReplierService cannot find the conversation when it locks the row, it throws PrintableException after opening the transaction. The transaction remains open.

Confirmed affected methods:
Thread\CreatorService, Thread\ReplierService, Thread\EditorService, Post\EditorService, Conversation\CreatorService, Conversation\ReplierService, Conversation\MessageEditorService, ProfilePost\EditorService, ProfilePostComment\EditorService, Report\CreatorService, Report\CommenterService, FeaturedContent\EditorService, Bookmark\EditorService

XFRM:
ResourceItem\Create, ResourceItem\ChangeType, ResourceUpdate\Create, ResourceUpdate\Edit, ResourceVersion\Create

XFMG:
Album\Creator, Album\Editor, Comment\Editor, Media\Editor, Media\MirrorCreator
 
Last edited:
Back
Top Bottom