diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 771c2f2e..963cfdbe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/pramen/core/src/main/scala/za/co/absa/pramen/core/runner/task/TaskRunnerBase.scala b/pramen/core/src/main/scala/za/co/absa/pramen/core/runner/task/TaskRunnerBase.scala index 07ce3e55..831d205a 100644 --- a/pramen/core/src/main/scala/za/co/absa/pramen/core/runner/task/TaskRunnerBase.scala +++ b/pramen/core/src/main/scala/za/co/absa/pramen/core/runner/task/TaskRunnerBase.scala @@ -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)