Skip to content

Commit

Permalink
Merge pull request #55 from regadas/fix_blocking_submitter_state
Browse files Browse the repository at this point in the history
Report job id if failure happens after submission
  • Loading branch information
jto authored Jun 24, 2021
2 parents 7605234 + 74c2127 commit 9c147ac
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions controllers/flinkcluster_submit_job_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ var submitJobScript = `
# Printing result to stdout. Use --output to specify output path.
# Job has been submitted with JobID ec74209eb4e3db8ae72db00bd7a830aa
#
# When failed (no jobID):
# When submission fails (no jobID):
#
# message: |
# Aborted submit because JobManager is unavailable.
Expand Down Expand Up @@ -87,10 +87,9 @@ function submit_job() {
# Submit job and extract the job ID
echo "/opt/flink/bin/flink run $*" | tee -a submit_log
if /opt/flink/bin/flink run "$@" 2>&1 | tee -a submit_log; then
local -r job_id_indicator="Job has been submitted with JobID"
job_id=$(grep "${job_id_indicator}" submit_log | awk -F "${job_id_indicator}" '{printf $2}' | awk '{printf $1}')
fi
/opt/flink/bin/flink run "$@" 2>&1 | tee -a submit_log
local -r job_id_indicator="Job has been submitted with JobID"
job_id=$(grep "${job_id_indicator}" submit_log | awk -F "${job_id_indicator}" '{printf $2}' | awk '{printf $1}')
# Write result as YAML format to pod termination-log.
# On failure, write log only.
Expand Down

0 comments on commit 9c147ac

Please sign in to comment.