Repository navigation
Replies: 2 comments
It doesn't look like there is anything built-in for that. You can create an enhancement for this and even suggest how you would like it to function - a mechanism for messaging like "only once" processing, or possibly provide enough cluster information to the provider so that the work can be split to each member, etc. |
0 replies
|
Afaik, the current implementation has another limitation for some use cases (event processing, in our case). The task lock is only hold as long as the task is expected to run (maximum). After that, the lock is removed and another node might run the task in parallel. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
something that we have noticed recently is that if we use a
ClusterAwareScheduledTaskRunner, it behaves a bit differently than we originally anticipated. We originally thought that if we schedule a task once per hour withCASTR, that it would run exactly once on our cluster, once per hour. However, since our cluster has 3 nodes, it runs once per hour on each node.Upon further inspection, we realized that the javadoc states that the runner only ensures that the executions on the different nodes are not concurrent. For some tasks, this is fine (deleting expired sessions, deleting users that haven't logged in in a while), but for a new use case (sending password expiry emails to users for a few days before their password expires), this lead to multiple emails being sent per user per day, which is of course not desired. We could alleviate this by setting some user attribute that they already received an email today, but this seems like an odd workaround to what we actually want: Running the task once per day, across the entire cluster. Does Keycloak currently provide facilities to run scheduled tasks like this?
Cheers,
Simon
All reactions