Skip to content

Commit 2fbea13

Browse files
authored
fix: Fire registratinChanged in IO pool. (#974)
Smack calls the reconnect callback while holding the XMPPConnection lock. Run our own listeners in an IO thread in case on of them blocks (as we've observed happening)
1 parent 0a5c16f commit 2fbea13

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

jicofo-common/src/main/java/org/jitsi/impl/protocol/xmpp/AbstractXmppProvider.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.*;
2121

2222
import org.jetbrains.annotations.*;
23+
import org.jitsi.jicofo.*;
2324
import org.jitsi.utils.logging2.*;
2425

2526
/**
@@ -83,20 +84,19 @@ protected void fireRegistrationStateChanged(boolean registered)
8384
}
8485

8586
for (RegistrationListener listener : listeners)
86-
try
87+
TaskPools.getIoPool().submit(() ->
8788
{
88-
listener.registrationChanged(registered);
89-
}
90-
catch (Throwable throwable)
91-
{
92-
logger.error(
93-
"An error occurred while executing "
94-
+ "RegistrationStateChangeListener"
95-
+ "#registrationStateChanged"
96-
+ "(RegistrationStateChangeEvent) of "
97-
+ listener,
98-
throwable);
99-
}
89+
try
90+
{
91+
listener.registrationChanged(registered);
92+
}
93+
catch (Throwable throwable)
94+
{
95+
logger.error(
96+
"An error occurred while executing registrationStateChanged() on " + listener,
97+
throwable);
98+
}
99+
});
100100
}
101101

102102
/**

0 commit comments

Comments
 (0)