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

Bugfix/incorrect place for description setting #506

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ jobs:
- name: Create Pull Request
run: gh pr create -B "$BASE" -H "release/$VERSION" --title "Release Pramen v$VERSION" --body 'Created by Github action'
env:
BASE: ${{ github.event.inputs.branch }}
BASE: ${{ github.head_ref || github.ref_name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.release_branch3.outputs.VERSION }}
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,18 @@ abstract class TaskRunnerBase(conf: Config,
/** Runs a task in the single thread. Performs all task logging and notification sending activities. */
protected def runTask(task: Task): RunStatus = {
val started = Instant.now()

runtimeConfig.sparkAppDescriptionTemplate.foreach { template =>
val description = applyAppDescriptionTemplate(template, task, runtimeConfig, conf)
val spark = SparkSession.builder().getOrCreate()
spark.sparkContext.setJobDescription(description)
}

task.job.operation.killMaxExecutionTimeSeconds match {
case Some(timeout) if timeout > 0 =>
@volatile var runStatus: RunStatus = null

try {
runtimeConfig.sparkAppDescriptionTemplate.foreach { template =>
val description = applyAppDescriptionTemplate(template, task, runtimeConfig, conf)
val spark = SparkSession.builder().getOrCreate()
spark.sparkContext.setJobDescription(description)
}

ThreadUtils.runWithTimeout(Duration(timeout, TimeUnit.SECONDS)) {
log.info(s"Running ${task.job.name} with the hard timeout = $timeout seconds.")
runStatus = doValidateAndRunTask(task)
Expand Down
Loading