mirror of
https://github.com/docker/build-push-action.git
synced 2025-05-06 21:49:33 +02:00
add retry to umount logic incase proc is still running
This commit is contained in:
parent
a759557443
commit
279255870a
3 changed files with 15 additions and 4 deletions
2
dist/index.js
generated
vendored
2
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
15
src/main.ts
15
src/main.ts
|
@ -587,8 +587,19 @@ actionsToolkit.run(
|
|||
if (stateHelper.remoteDockerBuildStatus != '') {
|
||||
try {
|
||||
await shutdownBuildkitd();
|
||||
await execAsync(`sudo umount ${mountPoint}`);
|
||||
core.debug(`${device} has been unmounted`);
|
||||
for (let attempt = 1; attempt <= 3; attempt++) {
|
||||
try {
|
||||
await execAsync(`sudo umount ${mountPoint}`);
|
||||
core.debug(`${device} has been unmounted`);
|
||||
break;
|
||||
} catch (error) {
|
||||
if (attempt === 3) {
|
||||
throw error;
|
||||
}
|
||||
core.warning(`Unmount failed, retrying (${attempt}/3)...`);
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
}
|
||||
}
|
||||
if (stateHelper.remoteDockerBuildStatus == 'success') {
|
||||
await reportBuildCompleted();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue