Run Configuration and Indices


I have a custom before task that I execute before running a configuration in one of our project.

The task performs the following steps:

  1. Delete some previously generated files (if any)
  2. Force to save the model(s) involved in the run config. This is done with the SaveRepositoryCommand executed inside an invokeAndWait closure
  3. Rebuild the model(s). This is largely based on the MakePointers task available in the MPS platform.

Now, the problem is that between steps 2 and 3, every now and then, the task fails with a message saying "Generation is not available until indices are built".

Is there any way to synchronize these two steps?




May be , try separating each step as individual before_task..


That's a possibility, but I think that even splitting them as separate tasks would not guarantee their synchronization.


The trick is, the before task which was created first (in time) will get executed first. If this approach does not work, a countdownlatch might help you. Countdownlatch helps when we have multiple threads running. The 3rd step (3rd thread) will have to wait until 2nd step is completed.. This can be achieved by latch.await()


Thanks for the suggestion.

That's doable, unless saving the models triggers some other non synchronous actions (e.g. building the indices). However, I was expecting that a closure running inside an invokeAndWait would do that for me.


Please sign in to leave a comment.