Charles Oliver N. wrote:
Well we definitely need to fix it. The problem here seems to be that one
of these maps is being modified while we’re trying to walk it. Do you
have any idea what the other thread might be doing at this point?
I’ll have a quick look at the code right now and see if I can come up
with anything simple to eliminate this problem. If you have some code we
can use to trigger this problem it would be a big help, or if you want
to stop by IRC we can talk about it more.
Don’t fear…it shall be fixed.
Ok, I see a couple simple fixes:
- Have new classes always create a new subclasses set, so the set itself
is never directly mutated. This allows iteration to happen safely
- Have iteration construct a copy of the set before iteration. This also
makes it safe, but cause potentially large amounts of useless objects
- Synchronize all use of subclasses set against a global lock.
I’ve implemented the first scenario since I think it represents the
least impact to the system and allows invalidation to be completely
lock-free. There could be a small performance impact when creating new
classes, especially lots of new classes when there’s lots of siblings
(new subclasses set creation will be O(n) on number of siblings). For
the moment, though, I haven’t seen any perf impact.
The patch for this is here: http://gist.github.com/94810
Someone else also reported this bug here:
Give the patch a try and let me know how it feels to you. And if you can
come up with a good case, we would still like to have it.
To unsubscribe from this list, please visit: