[ 
https://issues.apache.org/jira/browse/SYNCOPE-1970?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrea Patricelli updated SYNCOPE-1970:
---------------------------------------
    Description: 
Having a two node cluster syncope installation, say node A and node B:
 * Login in console as admin
 * Create a TASK_JOB implementation on node A like the following

 
{code:java}
import org.apache.syncope.common.lib.types.TaskType
import org.apache.syncope.core.provisioning.api.job.JobExecutionContext
import org.apache.syncope.core.provisioning.api.job.JobExecutionException
import org.apache.syncope.core.provisioning.api.job.SchedTaskJobDelegate
import org.slf4j.Logger
import org.slf4j.LoggerFactory
class TestBugJobDelegate implements SchedTaskJobDelegate {
   Logger LOG = LoggerFactory.getLogger(SchedTaskJobDelegate.class);
  
   int myvalue = 500;
  
  @Override
  void execute(TaskType taskType, String taskKey, JobExecutionContext context)
    throws JobExecutionException {
      LOG.info("This is the actual value >>>>>>> {}", myvalue);
  }
}
{code}
 * Create a scheduled task with TestBugJobDelegate as implementation
 * Run the sched task, let's say that syncope runs it on node A. A string like 
{noformat}
This is the actual value >>>>>>> 500{noformat}
 is printed on node A.

 * Then on node B edit the groovy implementation, e.g. setting myvalue to 1000
 * Run again the scheduled task, if it is run again on node A we're going to 
still see the old log printed 
{noformat}
This is the actual value >>>>>>> 500{noformat}

             instead of  
{noformat}
This is the actual value >>>>>>> 1000
{noformat}
            if running the sched task on node B the correct value is printed 
out.

The misbehavior happens if the groovy code change is made on the either node 
respect of the one where the scheduled task is fired. 

  was:
Having a two node cluster syncope installation, say node A and node B:
 * Login in console as admin
 * Create a TASK_JOB implementation on node A like the following

 
{code:java}
import org.apache.syncope.common.lib.types.TaskType
import org.apache.syncope.core.provisioning.api.job.JobExecutionContext
import org.apache.syncope.core.provisioning.api.job.JobExecutionException
import org.apache.syncope.core.provisioning.api.job.SchedTaskJobDelegate
import org.slf4j.Logger
import org.slf4j.LoggerFactory
class TestBugJobDelegate implements SchedTaskJobDelegate {
   Logger LOG = LoggerFactory.getLogger(SchedTaskJobDelegate.class);
  
   int myvalue = 500;
  
  @Override
  void execute(TaskType taskType, String taskKey, JobExecutionContext context)
    throws JobExecutionException {
      LOG.info("This is the actual value >>>>>>> {}", myvalue);
  }
}
{code}
 * Create a scheduled task with TestBugJobDelegate as implementation
 * Run the sched task, let's say that syncope runs it on node A. A string like 
{noformat}
This is the actual value >>>>>>> 500{noformat}
 is printed on node A.
 * Then on node B edit the groovy implementation, e.g. setting myvalue to 1000
 * Run again the scheduled task, if it is run again on node A we're going to 
still see the old log printed 
{noformat}
This is the actual value >>>>>>> 500{noformat}

 

             instead of 
{noformat}
This is the actual value >>>>>>> 1000{noformat}
 

            if running the sched task on node B the correct value is printed 
out.

The misbehavior happens if the groovy code change is made on the either node 
respect of the one where the scheduled task is fired. 


> Scheduled task Groovy implementation not updated when running in cluster
> ------------------------------------------------------------------------
>
>                 Key: SYNCOPE-1970
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-1970
>             Project: Syncope
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.0.16, 4.0.6, 4.1.1
>            Reporter: Andrea Patricelli
>            Priority: Major
>             Fix For: 4.0.7, 4.1.2
>
>
> Having a two node cluster syncope installation, say node A and node B:
>  * Login in console as admin
>  * Create a TASK_JOB implementation on node A like the following
>  
> {code:java}
> import org.apache.syncope.common.lib.types.TaskType
> import org.apache.syncope.core.provisioning.api.job.JobExecutionContext
> import org.apache.syncope.core.provisioning.api.job.JobExecutionException
> import org.apache.syncope.core.provisioning.api.job.SchedTaskJobDelegate
> import org.slf4j.Logger
> import org.slf4j.LoggerFactory
> class TestBugJobDelegate implements SchedTaskJobDelegate {
>    Logger LOG = LoggerFactory.getLogger(SchedTaskJobDelegate.class);
>   
>    int myvalue = 500;
>   
>   @Override
>   void execute(TaskType taskType, String taskKey, JobExecutionContext context)
>     throws JobExecutionException {
>       LOG.info("This is the actual value >>>>>>> {}", myvalue);
>   }
> }
> {code}
>  * Create a scheduled task with TestBugJobDelegate as implementation
>  * Run the sched task, let's say that syncope runs it on node A. A string 
> like 
> {noformat}
> This is the actual value >>>>>>> 500{noformat}
>  is printed on node A.
>  * Then on node B edit the groovy implementation, e.g. setting myvalue to 1000
>  * Run again the scheduled task, if it is run again on node A we're going to 
> still see the old log printed 
> {noformat}
> This is the actual value >>>>>>> 500{noformat}
>              instead of  
> {noformat}
> This is the actual value >>>>>>> 1000
> {noformat}
>             if running the sched task on node B the correct value is printed 
> out.
> The misbehavior happens if the groovy code change is made on the either node 
> respect of the one where the scheduled task is fired. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to