Skip to content

OF-3164: Avoid user lookup for JIDs without node to reduce exception overhead#3122

Open
guusdk wants to merge 1 commit intoigniterealtime:mainfrom
guusdk:OF-3164_IsRegisteredUser-exception-based-control-flow-workaround
Open

OF-3164: Avoid user lookup for JIDs without node to reduce exception overhead#3122
guusdk wants to merge 1 commit intoigniterealtime:mainfrom
guusdk:OF-3164_IsRegisteredUser-exception-based-control-flow-workaround

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.

@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
…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.
@akrherz akrherz force-pushed the OF-3164_IsRegisteredUser-exception-based-control-flow-workaround branch from db5aa1a to 4c36405 Compare February 10, 2026 20:53
@akrherz
Copy link
Member

akrherz commented Feb 10, 2026

rebased...

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.

2 participants