Beanshell cache not updated when modifying rue via debug or import using VSCode IIQDA

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

When changing rules via debug or import using VSCode IIQDA extension the old version of the rule is still used. It looks like the only way to use the new rule is by restarting the app server or adjusting it via the UI.

Is this new for IIQ8.3 and up or might I have accidentally changed a setting? As I have not noticed this behaviour before.

Is there a way to manually ‘refresh’ the Beanshell Rule cache?

– Remold

Hi @Remold

I do clear all the cache through debug page, whenever I change the code. It worked all the times. Did you try that ?

Thanks
Krish

That does indeed work, but I recall to just develop rules in debug and directly test the rule without resetting the configuration cache.

– Remold

If you run the Rule in debug page, you don’t need to reset the cache.

Currently I hardly run a rule from debug, as I have the RuleRunner Plugin installed :stuck_out_tongue_winking_eye:

But is the beanshell caching behaviour changed between 8.1 and 8.3?

– Remold

Hi Remold,
It’s known issue for very long time - sometime IIQ has problems with synchronisation of Beanshell changes between nodes. That generally means that if you modify the rule via debug - the change is available on the server where you were connected at the time of modification.

I solve it but writing small rule to clear caches and sync all nodes again

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule language="beanshell" name="ResetCache">
  <Source>

  import sailpoint.server.Environment;
  import sailpoint.server.Servicer;
  import sailpoint.server.CacheService;


  Environment env = Environment.getEnvironment();
  Servicer services = env.getServicer();
  CacheService caches = (CacheService)services.getService("Cache");
  if (caches != null) {
    caches.forceRefresh(context); 
  }

  </Source>
</Rule>

Important is that you have to execute it on all remaining nodes of your cluster. So in practice I usually create and instance of this rule for each host I have in the cluster and than via Sequence launcher execute it everywhere.

Hope this workaround solves the problem.

1 Like

The VSCode workflow is pretty simple (same as IIQDA) and I’ve modified the import method to do additional things like insert audit entries and do cache clearing. This would remove a manual step in your testing.

@markearnest with IIQ DA you’ll have the same issue - it will work only on machine to which you connect - rule on other machines will be cached

There is a reason why my sandbox/PoC/dev environments only have 1 server :stuck_out_tongue_winking_eye:

– Remold

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.