Closed kylev closed 8 years ago
This has been my recent every-few-hours bummer of a crash in my Sky Factory 2.5.4 world.
crash-2016-08-13_16.37.48-client.txt crash-2016-08-13_20.00.35-client.txt crash-2016-08-14_01.11.34-client.txt crash-2016-08-14_01.32.12-client.txt crash-2016-08-14_02.42.11-client.txt
That would only help if another thread was accessing the list. But this looks more like the task that is executed adding a new task.
That could be as well. I haven't found that exact pattern in the tracing of Sky Factory (yet). I need to get my dev env for all the parts ironed out.
I think this fix would handle your hypothesis, as well. You think? I've generally designed around any write access to a structure I'm iterating over, but I'm trying to be minimal here.
Also, given this is the only thing that uses the Scheduler right now, I've seen another modder using TimerTask rather than build is own delayed work queue. Maybe that could just get ripped out or replaced?
This is better handled by 9c1936869c452520ea2b8b8cb4c0ebedcf6f2769 and could be back-ported to 1.7.10.
Since user action events can happen at the same time as scheduled tasks may fire, we get CMEs when one adds to the list while the other removes from it and iterates it.
Minor performance penalty, but not user detectable.