Ticket #270 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

sometimes sitebot wouldn't announce new racer

Reported by: cheet4h Owned by: zubov
Priority: normal Milestone: 3.0
Component: SiteBot Version: 3.0alpha
Severity: normal Keywords:
Cc:

Description

if the SFVAnnouncer.java check for new racer and going through the iteration it can occurrence an ConcurrentModificationException

maybe a copy of the current Collection could fix this problem

Attachments

newracer.diff (1.8 KB) - added by cheet4h 5 months ago.
newracer_announce.diff (1.1 KB) - added by cheet4h 5 months ago.

Change History

Changed 5 months ago by cheet4h

Changed 5 months ago by djb61

Do you have an example stacktrace of a ConcurrentModificationException being thrown from this code?

If this can happen then rather than simply making a copy I'd prefer to investigate all the places this collection is accessed to see what else could be affected and potentially investigate using a thread safe collection or adding appropriate synchronization.

Changed 5 months ago by cheet4h

unfortunately not i tried to reproduce this error without success by my testings i wondering me because the sitebot doesn't announce any new racer line

Changed 5 months ago by cheet4h

Changed 5 months ago by cheet4h

by applying the newracer_announce.diff now the sitebot will announce if a new racer is joining a race

Changed 5 months ago by djb61

This fix is insufficient, to see the failure case try the following:

Have one user upload some files and then stop. Have a second user upload a new file (it is important that it is later in sequence in the list of files in the sfv than the files by the first user and that there are no other files listed laster in the sfv present).

E.g. with an sfv that listed .r00 then .r01,.r02 etc, have user 1 upload .r00 and .r01, then have user 2 upload .r02. The new racer announce will not appear.

Edit: it should be noted that the above failure case also exists in 2.0 from looking at the code.

Changed 5 months ago by djb61

  • status changed from new to closed
  • resolution set to fixed

Fixed in [2028]

Note that it is still possible for this event to be missed due to timing issues, i.e. if the user completes a second file in the directory before the event fired from their first file completion gets processed. There isn't really much that can be done about this issue however so closing the ticket anyway.

Note: See TracTickets for help on using tickets.