Skip to content

Commit

Permalink
Add comment regarding race condition to keep track of the problem
Browse files Browse the repository at this point in the history
Signed-off-by: Yannic Klem <Yannic.Klem@bosch.io>
  • Loading branch information
Yannic92 committed May 31, 2022
1 parent e0fe64a commit 5654ca1
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -278,6 +278,11 @@ protected Optional<PolicyId> getPolicyIdOfCachedEnforcer() {
private void enforceSignal(final S signal) {
final CompletionStage<Void> enforcementCompletion = doEnforceSignal(signal, getSender())
.thenAccept(authorizedSignal -> {
/*
* TODO: CR-11446 This is potential race condition. It's not guaranteed that the policy is already
* updated when this actor tries to reload the enforcer. That way it could happen that
* an old version of the enforcer is loaded and kept in cache.
*/
if (shouldReloadAfterEnforcement(authorizedSignal)) {
// trigger reloading the policy
performPolicyEnforcerReload();
Expand Down

0 comments on commit 5654ca1

Please sign in to comment.