Skip to content

Conversation

@guusdk
Copy link
Member

@guusdk guusdk commented Jan 7, 2026

Prevent execution of user lookup logic when the provided JID has no node. JIDs without a node part cannot represent a local user, yet currently flow through UserManager.isRegisteredUser(), which relies on exception-based control flow when the user does not exist.

Thread dumps show significant CPU time spent constructing UserNotFoundException instances (Throwable.fillInStackTrace) on this hot path.

This change short-circuits the lookup for node-less JIDs, avoiding the exception-heavy path and reducing unnecessary CPU usage under load.

Note: This is a partial workaround. A full fix should refactor user existence checks to avoid exceptions for normal control flow.

…overhead

Prevent execution of user lookup logic when the provided JID has no node. JIDs without a node part cannot represent a local user, yet currently flow through UserManager.isRegisteredUser(), which relies on exception-based control flow when the user does not exist.

Thread dumps show significant CPU time spent constructing UserNotFoundException instances (Throwable.fillInStackTrace) on this hot path.

This change short-circuits the lookup for node-less JIDs, avoiding the exception-heavy path and reducing unnecessary CPU usage under load.

Note: This is a partial workaround. A full fix should refactor user existence checks to avoid exceptions for normal control flow.
@guusdk guusdk added the backport 5.0 on merge, GHA will generate a PR with these changes against 5.0 branch label Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 5.0 on merge, GHA will generate a PR with these changes against 5.0 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant