enragedginger/akka-quartz-scheduler

Thread safety

Closed this issue · 1 comments

Hi,

Should QuartzSchedulerExtension be made thread-safe?

My understanding is that Akka extensions must normally manage thread-safety internally. At the moment, I think that it is possible for concurrent access to createSchedule to result in a created schedule being lost if the reads, updates and writes occurring in schedules += (name.toUpperCase -> quartzSchedule) are interleaved - causing a subsequent call to schedule to fail.

Thanks,
-Dan

QuartzSchedulerExtension must be thread-safe.
That's not the only problem, runningJobs is mutable.Map, but not Concurrent, so it's quite simple to get NPE.

I tried to find possibility to remove schedules after restart and found that this library is dangerous to use. So the only way to use it now is to use it from the single actor.