[jitsi-dev] Issue (race?) while preparing the list of available server chat rooms


#1

Hi all,

I noticed a rather nasty issue while listing IRC chat rooms. I think it
is not actually caused by the IRC implementation, but due to its large
number of chat rooms (easily 4000+ on a decent server) it does make it
apparent. This issue wasn't there previously and I believe it may be
caused by some of the recent changes w.r.t. smoothing out the UI. (This
is a bit of a guess, but I arrived there while pinpointing changes
around the area of server chat room listing code.)

To recreate the issue:
1. Set up an IRC account and connect to an IRC server.
2. Go to menu option "Add chat room".
3. Select IRC account.
4. Click list button such that chat rooms are queried.
5. Wait until listing is done and first chat rooms appear in the UI.

See also this (very small) part of logging output:
http://pastebin.com/3fazn9jQ

ArrayIndexOutOfBoundsException is caused, I believe due to a race
condition between 1. adding new chat rooms to the list (and sort them),
and 2. updating the UI to show the newly added item. Though I haven't
completely figured it out yet.
Notice, though, that the actual size of the Vector increases steadily,
while the faulty index jumps all over the range. I suspect this is
because this index is based on its sorted position, and the chat room
list arrives in random order thus position changes after sorting.

I'll have another look at it soon, but I figure that you might be able
to pinpoint the actual problem much easier.

Thanks in advance,
Danny

PS: All the exception throwing really kills performance and
responsiveness :stuck_out_tongue:


#2

I have no clue about the actual code used here, but two methods of WinForms come to mind:
Begin/EndUpdate

It might be necessary to introduce something like this. When the service notifies an update beginning, the UI should do no rendering anymore until it is told so, and then update everything in one flush.

Freundliche Grüsse,
Ingo Bauersachs

-- sent from my mobile

···

Le 14.08.2014 à 03:37, "Danny van Heumen" <danny@dannyvanheumen.nl> a écrit :

Hi all,

I noticed a rather nasty issue while listing IRC chat rooms. I think it
is not actually caused by the IRC implementation, but due to its large
number of chat rooms (easily 4000+ on a decent server) it does make it
apparent. This issue wasn't there previously and I believe it may be
caused by some of the recent changes w.r.t. smoothing out the UI. (This
is a bit of a guess, but I arrived there while pinpointing changes
around the area of server chat room listing code.)

To recreate the issue:
1. Set up an IRC account and connect to an IRC server.
2. Go to menu option "Add chat room".
3. Select IRC account.
4. Click list button such that chat rooms are queried.
5. Wait until listing is done and first chat rooms appear in the UI.

See also this (very small) part of logging output:
http://pastebin.com/3fazn9jQ

ArrayIndexOutOfBoundsException is caused, I believe due to a race
condition between 1. adding new chat rooms to the list (and sort them),
and 2. updating the UI to show the newly added item. Though I haven't
completely figured it out yet.
Notice, though, that the actual size of the Vector increases steadily,
while the faulty index jumps all over the range. I suspect this is
because this index is based on its sorted position, and the chat room
list arrives in random order thus position changes after sorting.

I'll have another look at it soon, but I figure that you might be able
to pinpoint the actual problem much easier.

Thanks in advance,
Danny

PS: All the exception throwing really kills performance and
responsiveness :stuck_out_tongue:

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#3

Hi Ingo,

Indeed. I know the functions you're talking about. I thought about the
same thing. I'll have a look into changing that. I don't think it'll be
too complicated, since it's kind of the same approach just for multiple
entries.
I am a little curious if this kind of issue could arise with with few
additions. It seems to have some characteristics of a race condition, so
it might occasionally happen anyway.

Danny

···

On 08/14/2014 05:32 AM, Ingo Bauersachs wrote:

I have no clue about the actual code used here, but two methods of WinForms come to mind:
Begin/EndUpdate

It might be necessary to introduce something like this. When the service notifies an update beginning, the UI should do no rendering anymore until it is told so, and then update everything in one flush.

Freundliche Grüsse,
Ingo Bauersachs

-- sent from my mobile

Le 14.08.2014 à 03:37, "Danny van Heumen" <danny@dannyvanheumen.nl> a écrit :

Hi all,

I noticed a rather nasty issue while listing IRC chat rooms. I think it
is not actually caused by the IRC implementation, but due to its large
number of chat rooms (easily 4000+ on a decent server) it does make it
apparent. This issue wasn't there previously and I believe it may be
caused by some of the recent changes w.r.t. smoothing out the UI. (This
is a bit of a guess, but I arrived there while pinpointing changes
around the area of server chat room listing code.)

To recreate the issue:
1. Set up an IRC account and connect to an IRC server.
2. Go to menu option "Add chat room".
3. Select IRC account.
4. Click list button such that chat rooms are queried.
5. Wait until listing is done and first chat rooms appear in the UI.

See also this (very small) part of logging output:
http://pastebin.com/3fazn9jQ

ArrayIndexOutOfBoundsException is caused, I believe due to a race
condition between 1. adding new chat rooms to the list (and sort them),
and 2. updating the UI to show the newly added item. Though I haven't
completely figured it out yet.
Notice, though, that the actual size of the Vector increases steadily,
while the faulty index jumps all over the range. I suspect this is
because this index is based on its sorted position, and the chat room
list arrives in random order thus position changes after sorting.

I'll have another look at it soon, but I figure that you might be able
to pinpoint the actual problem much easier.

Thanks in advance,
Danny

PS: All the exception throwing really kills performance and
responsiveness :stuck_out_tongue:

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev