Commit 86e23465 authored by Mohamed Khalil Labidi's avatar Mohamed Khalil Labidi
Browse files

First draft of the waiting solution

parent 9bbf96e7
...@@ -789,13 +789,23 @@ public class PAGateway { ...@@ -789,13 +789,23 @@ public class PAGateway {
tasksTokens.forEach(taskToken -> { tasksTokens.forEach(taskToken -> {
String suffix = "_" + tasksTokens.indexOf(taskToken); String suffix = "_" + tasksTokens.indexOf(taskToken);
scriptTasks.addAll(createAppTasks(task, suffix, taskToken)); scriptTasks.addAll(0, createAppTasks(task, suffix, taskToken));
scriptTasks.add(0, createLockHandlerTask(task.getName(), suffix, taskToken));
scriptTasks.get(1).addDependence(scriptTasks.get(0));
}); });
} }
return scriptTasks; return scriptTasks;
} }
private ScriptTask createLockHandlerTask(String taskName, String suffix, String taskToken) {
String lockTaskName = "waitForLock_" + taskName + suffix;
ScriptTask lockHandlerTask = PAFactory.createBashScriptTaskFromFile(lockTaskName, "wait_for_lock_script.sh");
lockHandlerTask.addGenericInformation("NODE_ACCESS_TOKEN", taskToken);
return lockHandlerTask;
}
private void setAllMandatoryDependencies(TaskFlowJob paJob, Job jobToSubmit) { private void setAllMandatoryDependencies(TaskFlowJob paJob, Job jobToSubmit) {
jobToSubmit.getTasks().forEach(task -> { jobToSubmit.getTasks().forEach(task -> {
if (task.getParentTasks() != null && !task.getParentTasks().isEmpty()) { if (task.getParentTasks() != null && !task.getParentTasks().isEmpty()) {
......
i=0
while [ `ps aux | grep [l]ock_is_held | wc -l` != 0 ]; do
echo "Lock_is_held $i"
ps aux | grep [l]ock_is_held
sleep 10
((i=i+10));
done
echo "Exited the while loop, time spent: $i"
ps aux | grep [a]pt
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment