Skip to content

Commit

Permalink
src: stop spurious warnings on buildkit shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
adityamaru committed Dec 20, 2024
1 parent 31dd0cc commit 9a524c6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ actionsToolkit.run(
});
}
try {
const {stdout} = await execAsync('pgrep -f buildkitd');
const {stdout} = await execAsync('pgrep buildkitd');
if (stdout.trim()) {
await shutdownBuildkitd();
core.info('Shutdown buildkitd');
Expand Down Expand Up @@ -490,8 +490,8 @@ export async function shutdownBuildkitd(): Promise<void> {
// Wait for buildkitd to shutdown with backoff retry
while (Date.now() - startTime < timeout) {
try {
await execAsync('pgrep -f buildkitd');
// Process still exists, wait and retry
const {stdout} = await execAsync('pgrep buildkitd');
core.info(`buildkitd process still running with PID: ${stdout.trim()}`);
await new Promise(resolve => setTimeout(resolve, backoff));
} catch (error) {
if (error.code === 1) {
Expand Down
4 changes: 2 additions & 2 deletions src/setup_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ async function startBuildkitd(parallelism: number, device: string): Promise<stri

while (Date.now() - startTime < timeout) {
try {
const {stdout} = await execAsync('pgrep -f buildkitd');
const {stdout} = await execAsync('pgrep buildkitd');
if (stdout.trim()) {
core.debug('buildkitd daemon started successfully');
core.info(`buildkitd daemon started successfully with PID ${stdout.trim()}`);
return addr;
}
} catch (error) {
Expand Down

0 comments on commit 9a524c6

Please sign in to comment.