-
Notifications
You must be signed in to change notification settings - Fork 203
Schedulers documents are not cleared #136
Comments
A field with last scheduler activity sounds good to me. When would it be set, however? |
I was thinking that this lastCheckingDate could be calculated from lastCheckinTime and simply stored applied in SchedulerDao.createUpdateClause(). However, there are two points I have just found out:
But I have studied a bit how it is implemented in original Quartz, and they clear old records during checkingIn - when they also recover old triggers. Considering the clustered mode, the simplest solution seems to be not-the-best-option. |
Hi, Seems the _schedulers collection is never cleaned up. Might be problematic in k8s for stateless services. Thanks |
This is open source software. You are welcome to contribute a fix. |
If there is no plan and there is no other workaround, I can contribute a fix. |
As far as I remember, the issue seemed easy to fix, but during implementation I've came across more complicated details, which I've described above. I'm not using this cool library anymore, so I won't be able to help, but keeping my fingers crossed 🤞 |
I've come on a bug [or not implemented feature?] where scheduler documents are not cleared from mongo, leading to new entries with each deployment - seems trivial but it's harder but can make some things properly (besides growing collection) - like monitoring of how many active schedulers there are.
I propose 2 solutions - either make other cluster instances scan schedulers collection and periodically clean old ones (or make it configurable) or simply change/add a field "lastCheckingDate" into the schedulers objects (with Date type) - then one can simply add a TTL index to mongo, and everything would be fine.
Please tell me if I hadn't noticed something important, or maybe creating a TTL index for old, inactive cluster instances would break some stuff I'm not aware of. (but placing TTL index for like 1 hour would probably not break such things - still not sure how about lock or that kind of stuff)
Please share your thoughts!
The text was updated successfully, but these errors were encountered: