Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread safety #33

Closed
dspasojevic opened this issue Mar 29, 2016 · 1 comment · Fixed by #96
Closed

Thread safety #33

dspasojevic opened this issue Mar 29, 2016 · 1 comment · Fixed by #96

Comments

@dspasojevic
Copy link

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

@Alefas
Copy link

Alefas commented Nov 15, 2016

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.

arhathq pushed a commit to arhathq/akka-quartz-scheduler that referenced this issue Mar 29, 2017
benwaffle pushed a commit to benwaffle/akka-quartz-scheduler that referenced this issue May 20, 2020
@benwaffle benwaffle mentioned this issue May 20, 2020
enragedginger pushed a commit that referenced this issue May 21, 2020
* Thread safety fix for the issue #33

* Simplify code

* Don't uppercase the schedule name

* use TrieMap

* optimize imports

* code style

Co-authored-by: Alexander Kuleshov <oleksandr.kulieshov@globoforce.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants