Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to retry postprocessing of pulsar ghost jobs #1987

Open
cat-bro opened this issue Jun 3, 2024 · 0 comments
Open

Add script to retry postprocessing of pulsar ghost jobs #1987

cat-bro opened this issue Jun 3, 2024 · 0 comments

Comments

@cat-bro
Copy link
Collaborator

cat-bro commented Jun 3, 2024

This is on pulsar-qld-high-mem0 and pulsar-qld-high-mem1 as /home/ubuntu/ghost_jobs.sh and works some of the time. Sometimes the restart of pulsar needs to be skipped.

jwd_path='/mnt/pulsar/files/staging'
active_jobs_path='/mnt/pulsar/files/persistent_data/_default_-active-jobs'

remove_final_status_file () {
    job_id="$1"
    [ ! $job_id ] && echo 'job ID is required for remove_final_status';
    rm "${jwd_path}/${job_id}/final_status";
}

set_final_status_file () {
    job_id="$1"
    [ ! $job_id ] && echo 'job ID is required for set_final_status';
    echo -n '"complete"' > "${jwd_path}/${job_id}/final_status";
}

remove_postprocessed_file () {
    job_id="$1"
    [ ! $job_id ] && echo 'job ID is required for remove_postprocessed_file';
    rm "${jwd_path}/${job_id}/postprocessed";
}

set_active_job_file () {
    job_id="$1"
    [ ! $job_id ] && echo 'job ID is required for set_active_job_file';
    touch "${active_jobs_path}/${job_id}"
}

retry_ghost_jobs () {
    for x in $@; do
        remove_postprocessed_file $x;
        remove_final_status_file $x;
        set_active_job_file $x;
    done
    sudo systemctl restart pulsar
    sleep 10;
    for x in $@; do
        set_final_status_file $x;
    done
}
@cat-bro cat-bro changed the title Add script to restart pulsar ghost jobs Add script to retry postprocessing of pulsar ghost jobs Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant