Skip to content

Commit dc41aa1

Browse files
authored
Clean up existing swapfile before trying to allocate a new one (#6066)
Fix a potential bug from #6058, here is what I see in the CI when it happens https://github.com/pytorch/pytorch/actions/runs/12360769784/job/34497379880?pr=143316#step:5:165
1 parent 9bf99ca commit dc41aa1

File tree

1 file changed

+4
-0
lines changed
  • terraform-aws-github-runner/modules/runners-instances/templates

1 file changed

+4
-0
lines changed

terraform-aws-github-runner/modules/runners-instances/templates/user-data.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ fi
138138

139139
${post_install}
140140

141+
# Cleanup any existing swapfile just to be sure
142+
sudo swapoff /swapfile
143+
sudo rm /swapfile
144+
# before allocating a new one
141145
sudo fallocate -l 3G /swapfile
142146
sudo chmod 600 /swapfile
143147
sudo mkswap /swapfile

0 commit comments

Comments
 (0)