-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Offload xmpp/smack processing threads. #500
Conversation
Make sure we do not send and/or wait for responses in the smack threads.
Codecov Report
@@ Coverage Diff @@
## master #500 +/- ##
============================================
+ Coverage 20.82% 21.02% +0.20%
- Complexity 286 292 +6
============================================
Files 74 74
Lines 6186 6220 +34
Branches 832 832
============================================
+ Hits 1288 1308 +20
- Misses 4675 4690 +15
+ Partials 223 222 -1
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
More discussions: https://discourse.igniterealtime.org/t/thread-stuck-in-multiuserchat-enter-forever/92090/15?u=flow |
@@ -603,7 +612,7 @@ private synchronized void setXmppProvider( | |||
|
|||
if (xmppProvider.isRegistered()) | |||
{ | |||
joinConferenceRoom(); | |||
xmppExecutorPool.execute(this::joinConferenceRoom); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might swallow exceptions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
joinConferenceRoom() itself has one big try catch, that should catch everything...
* A thread pool used to offload xmpp execution in a new thread to avoid blocking | ||
* xmpp threads. | ||
*/ | ||
public static final ExecutorService xmppExecutorPool = Util.createNewThreadPool("xmpp-executor-pool"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not have a generic "io" thread pool in jigasi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing, this becomes one for the xmpp handling.
@@ -1081,6 +1100,11 @@ public void serviceChanged(ServiceEvent serviceEvent) | |||
|
|||
@Override | |||
public void memberPresenceChanged(ChatRoomMemberPresenceChangeEvent evt) | |||
{ | |||
xmppExecutorPool.execute(() -> memberPresenceChangedInternal(evt)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These may now execute concurrently or out of order. Do they need to go on a queue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that matters ...
@@ -624,7 +624,7 @@ public void notifyChatRoomMemberJoined(ChatRoomMember member) | |||
public void notifyChatRoomMemberLeft(ChatRoomMember member) | |||
{ | |||
// if this is the sip hanging up (stopping) skip playing | |||
if (gatewaySession.getJvbConference().isStarted() | |||
if (gatewaySession.getJvbConference() != null && gatewaySession.getJvbConference().isStarted() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AbstractGatewaySession.jvbConference can change to null, so this can still produce an NPE (granted, rarely)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Make sure we do not send and/or wait for responses in the smack threads.