Skip to content

Commit 986dfcf

Browse files
committed
ci: detect and kill stray runLinter processes before linting (#34011)
Part of an investigation of hanging 'lint mathlib' steps across workflows. We have noticed stray instances of these processes active in subsequent runs. Let's see if the hangs can be mitigated by killing these before starting the linting step. This would point to some synchronization issue between these stray instances - a bit of a long shot, but worth a try. Identifying where these strays are coming from might also give some insight. System logs show that sometimes these processes are affected by the Linux OOM killer.
1 parent 3734333 commit 986dfcf

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

.github/build.in.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,19 @@ jobs:
496496
# cd pr-branch
497497
# env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
498498

499+
- name: kill stray runLinter processes
500+
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
501+
continue-on-error: true
502+
shell: bash
503+
run: |
504+
echo "Checking for runLinter processes..."
505+
if ps -eo pid,lstart,command | grep -F runLinter | grep -v grep; then
506+
echo "Killing runLinter processes..."
507+
pkill -f runLinter || true
508+
else
509+
echo "No stray runLinter processes found."
510+
fi
511+
499512
- name: lint mathlib
500513
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
501514
id: lint
@@ -546,6 +559,15 @@ jobs:
546559
exit 1
547560
fi
548561
562+
- name: list stray runLinter processes
563+
shell: bash
564+
if: always()
565+
run: |
566+
echo "Checking for runLinter processes..."
567+
if ! ps -eo pid,lstart,command | grep -F runLinter | grep -v grep; then
568+
echo "No stray runLinter processes found."
569+
fi
570+
549571
- name: Post comments for lean-pr-testing-NNNN and batteries-pr-testing-NNNN branches
550572
if: always()
551573
shell: bash

.github/workflows/bors.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,19 @@ jobs:
506506
# cd pr-branch
507507
# env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
508508

509+
- name: kill stray runLinter processes
510+
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
511+
continue-on-error: true
512+
shell: bash
513+
run: |
514+
echo "Checking for runLinter processes..."
515+
if ps -eo pid,lstart,command | grep -F runLinter | grep -v grep; then
516+
echo "Killing runLinter processes..."
517+
pkill -f runLinter || true
518+
else
519+
echo "No stray runLinter processes found."
520+
fi
521+
509522
- name: lint mathlib
510523
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
511524
id: lint
@@ -556,6 +569,15 @@ jobs:
556569
exit 1
557570
fi
558571
572+
- name: list stray runLinter processes
573+
shell: bash
574+
if: always()
575+
run: |
576+
echo "Checking for runLinter processes..."
577+
if ! ps -eo pid,lstart,command | grep -F runLinter | grep -v grep; then
578+
echo "No stray runLinter processes found."
579+
fi
580+
559581
- name: Post comments for lean-pr-testing-NNNN and batteries-pr-testing-NNNN branches
560582
if: always()
561583
shell: bash

.github/workflows/build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,19 @@ jobs:
512512
# cd pr-branch
513513
# env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
514514

515+
- name: kill stray runLinter processes
516+
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
517+
continue-on-error: true
518+
shell: bash
519+
run: |
520+
echo "Checking for runLinter processes..."
521+
if ps -eo pid,lstart,command | grep -F runLinter | grep -v grep; then
522+
echo "Killing runLinter processes..."
523+
pkill -f runLinter || true
524+
else
525+
echo "No stray runLinter processes found."
526+
fi
527+
515528
- name: lint mathlib
516529
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
517530
id: lint
@@ -562,6 +575,15 @@ jobs:
562575
exit 1
563576
fi
564577
578+
- name: list stray runLinter processes
579+
shell: bash
580+
if: always()
581+
run: |
582+
echo "Checking for runLinter processes..."
583+
if ! ps -eo pid,lstart,command | grep -F runLinter | grep -v grep; then
584+
echo "No stray runLinter processes found."
585+
fi
586+
565587
- name: Post comments for lean-pr-testing-NNNN and batteries-pr-testing-NNNN branches
566588
if: always()
567589
shell: bash

.github/workflows/build_fork.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,19 @@ jobs:
510510
# cd pr-branch
511511
# env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
512512

513+
- name: kill stray runLinter processes
514+
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
515+
continue-on-error: true
516+
shell: bash
517+
run: |
518+
echo "Checking for runLinter processes..."
519+
if ps -eo pid,lstart,command | grep -F runLinter | grep -v grep; then
520+
echo "Killing runLinter processes..."
521+
pkill -f runLinter || true
522+
else
523+
echo "No stray runLinter processes found."
524+
fi
525+
513526
- name: lint mathlib
514527
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
515528
id: lint
@@ -560,6 +573,15 @@ jobs:
560573
exit 1
561574
fi
562575
576+
- name: list stray runLinter processes
577+
shell: bash
578+
if: always()
579+
run: |
580+
echo "Checking for runLinter processes..."
581+
if ! ps -eo pid,lstart,command | grep -F runLinter | grep -v grep; then
582+
echo "No stray runLinter processes found."
583+
fi
584+
563585
- name: Post comments for lean-pr-testing-NNNN and batteries-pr-testing-NNNN branches
564586
if: always()
565587
shell: bash

0 commit comments

Comments
 (0)