This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 38244 - ConcurrentModification in Childen.Keys
Summary: ConcurrentModification in Childen.Keys
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Action Items (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: tasklist-issues@contrib
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-19 14:55 UTC by _ pkuzel
Modified: 2004-03-02 08:47 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The exception (999 bytes, text/plain)
2003-12-19 14:57 UTC, _ pkuzel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ pkuzel 2003-12-19 14:55:52 UTC
I scanned for TODOs and got ~20 attached CMEs.
Comment 1 _ pkuzel 2003-12-19 14:57:04 UTC
Created attachment 12643 [details]
The exception
Comment 2 Petr Nejedly 2004-01-06 15:14:25 UTC
Your fault.
You give a collection to somebody to process (to Children.keys) and
keep modifying it from other thread.
You'd best pass a clone of the original collection.
Comment 3 Jan Lahoda 2004-01-06 15:29:15 UTC
Regardless where the problem is, I think this is very bad and should
be fixed before release. Rising priority to P2.
Comment 4 _ pkuzel 2004-01-06 16:17:16 UTC
It's caused by 37802 workaround.
Comment 5 _ tboudreau 2004-01-06 16:38:09 UTC
37802 is not likely to be fixed until TTV is rewritten, which is
definitely not for 3.6.
Comment 6 Jesse Glick 2004-01-06 16:54:26 UTC
True, TaskChildren.refreshKeys has

// #37802 XXX workaround
final Collection finalKeys = keys;
Mutex.EVENT.readAccess(new Runnable() {
    public void run() {
        setKeys(finalKeys);
    }
});

which should probably be amended to e.g.

final Task[] tasks = (Task[])keys.toArray(new Task[keys.size()]);
Mutex.EVENT.readAccess(new Runnable() {
    public void run() {
        setKeys(tasks);
    }
});

or change

keys = parent.getSubtasks();

to

keys = new ArrayList(parent.getSubtasks());

Looks like an easy fix, should do it ASAP. No dependency on issue
#37802 AFAICT.

(BTW I never got this exception myself, for whatever reason.)
Comment 7 _ pkuzel 2004-01-06 17:06:29 UTC
It's easy, but the new allocation press on GC and the functionality is
already fighting performance probs.
Comment 8 Jesse Glick 2004-01-06 17:24:42 UTC
I can assure you that whatever you are allocating here, Children,
Visualizers, Explorer, ... will allocate ten times as much before
anything gets displayed.
Comment 9 Petr Nejedly 2004-01-07 11:20:27 UTC
BTW: if you anticipate heavy traffic on setKeys call, you'd better
coalesce the updates. If your scanned generates 100 hits per second,
the user won't read them that fast anyway.
Comment 10 Milan Kubec 2004-03-02 08:47:30 UTC
Please, reporter, could you verify fixed issues. Thanks a lot.