azkaban/azkaban2 — pull request #35 by smeder (2013-08-15 13:30:57+00:00)
Title: Fix for concurrent modification exception during schedule load

We were seeing the following exception during Azkaban startup:

Caused by: java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:819)
at java.util.ArrayList$Itr.next(ArrayList.java:791)
at azkaban.scheduler.JdbcScheduleLoader.loadSchedules(JdbcScheduleLoader.java:152)
at azkaban.scheduler.ScheduleManager.(ScheduleManager.java:92)
at azkaban.webapp.AzkabanWebServer.loadScheduleManager(AzkabanWebServer.java:224)
at azkaban.webapp.AzkabanWebServer.(AzkabanWebServer.java:163)
at azkaban.webapp.AzkabanWebServer.main(AzkabanWebServer.java:420)
... 8 more

which is caused by the call to schedules.remove inside the for each loop. This patch fixes the issue by switching to explicitly iterating using a iterator.