-
Notifications
You must be signed in to change notification settings - Fork 347
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
Hack to work around a race in Smack. #816
Hack to work around a race in Smack. #816
Conversation
(See commit 3f57099 for an explanation of the race.)
Codecov Report
@@ Coverage Diff @@
## master #816 +/- ##
============================================
- Coverage 45.09% 44.70% -0.39%
+ Complexity 761 750 -11
============================================
Files 111 111
Lines 6511 6527 +16
Branches 918 919 +1
============================================
- Hits 2936 2918 -18
- Misses 3168 3195 +27
- Partials 407 414 +7
Continue to review full report at Codecov.
|
occupantsMapField.setAccessible(true); | ||
|
||
Map<EntityFullJid, Presence> occupantsMap = (Map<EntityFullJid, Presence>)occupantsMapField.get(muc); | ||
occupantsMap.clear(); |
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.
What about printing a log if there was something in the map?
Field occupantsMapField = null; | ||
try | ||
{ | ||
occupantsMapField = muc.getClass().getField("occupantsMap"); |
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 should be getDeclaredField
I did some automation and reverted the previous change and not I cannot hit it ... it is so strange ... I even add in prosody code to send a self presence update before the unavailable message and I see it in jicofo xmpp logs but still nothing, I ran 50 attempts ... will leave it now to do more attempts during the day. |
Ok, here is an update. Out of 200 runs managed to repro it once and the fix with clearing the map worked, no locking. |
And leaving just the fix from Friday I was able to repro in around 60 attempts. So I think we need this one :) |
(See commit 3f57099 for an explanation of the race.)