Skip to content

Commit 911f2d0

Browse files
committed
chore: streamline k8s job TTLs (#1008)
Jobs with 0 TTL are harder to inspect as the job is destroyed after finishing. This patch sets a standard length of TTL for k8s jobs or adds a comment to explain why a longer TTL can't be used. Bug: T411792
1 parent 2ac7fde commit 911f2d0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

app/Jobs/ProcessMediaWikiJobsJob.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public function handle(Client $kubernetesClient, MediaWikiHostResolver $resolver
7474
],
7575
],
7676
'spec' => [
77+
// This is set to immediately expire since the name of the job is used as the lock to prevent creating duplicates of this Kubernetes Job for any given Wiki.
7778
'ttlSecondsAfterFinished' => 0,
7879
'template' => [
7980
'metadata' => [

app/Jobs/SpawnQueryserviceUpdaterJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function handle(Client $kubernetesClient): void {
6767
],
6868
],
6969
'spec' => [
70-
'ttlSecondsAfterFinished' => 14 * 24 * 60 * 60, // 2 weeks
70+
'ttlSecondsAfterFinished' => 24 * 60 * 60 * 7, // 1 week
7171
'template' => [
7272
'metadata' => [
7373
'name' => 'run-qs-updater',

app/Jobs/WikiEntityImportJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private function constructSpec(): array {
153153
],
154154
],
155155
'spec' => [
156-
'ttlSecondsAfterFinished' => 0,
156+
'ttlSecondsAfterFinished' => 24 * 60 * 60 * 7, // 1 week
157157
'backoffLimit' => 0,
158158
'template' => [
159159
'metadata' => [

0 commit comments

Comments
 (0)