Skip to content

Commit 735bbec

Browse files
refactor: remove env var, change debug to info, reduce timeout to 10s
Co-Authored-By: maru@blacksmith.sh <adityamaru@gmail.com>
1 parent 097bde4 commit 735bbec

3 files changed

Lines changed: 14 additions & 20 deletions

File tree

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function getDeviceFromMount(mountPath: string): Promise<string | null> {
4040
return device;
4141
}
4242
} catch {
43-
core.debug(`findmnt failed for ${mountPath}, trying mount command`);
43+
core.info(`findmnt failed for ${mountPath}, trying mount command`);
4444
}
4545

4646
try {
@@ -50,22 +50,16 @@ async function getDeviceFromMount(mountPath: string): Promise<string | null> {
5050
return match[1];
5151
}
5252
} catch {
53-
core.debug(`mount grep failed for ${mountPath}`);
53+
core.info(`mount grep failed for ${mountPath}`);
5454
}
5555

5656
return null;
5757
}
5858

5959
async function flushBlockDevice(devicePath: string): Promise<void> {
60-
const enableFlush = process.env.ENABLE_DURABILITY_FLUSH !== "false";
61-
if (!enableFlush) {
62-
core.debug("Durability flush disabled via ENABLE_DURABILITY_FLUSH=false");
63-
return;
64-
}
65-
6660
const deviceName = devicePath.replace("/dev/", "");
6761
if (!deviceName) {
68-
core.warning(`Could not extract device name from ${devicePath}`);
62+
core.info(`Could not extract device name from ${devicePath}`);
6963
return;
7064
}
7165

@@ -76,13 +70,13 @@ async function flushBlockDevice(devicePath: string): Promise<void> {
7670
const { stdout } = await execAsync(`cat ${statPath}`);
7771
beforeStats = stdout.trim();
7872
} catch {
79-
core.debug(`Could not read block device stats before flush: ${statPath}`);
73+
core.info(`Could not read block device stats before flush: ${statPath}`);
8074
}
8175

8276
const startTime = Date.now();
8377
try {
8478
await execAsync(`sudo blockdev --flushbufs ${devicePath}`, {
85-
timeout: 30000,
79+
timeout: 10000,
8680
});
8781
const duration = Date.now() - startTime;
8882

@@ -91,7 +85,7 @@ async function flushBlockDevice(devicePath: string): Promise<void> {
9185
const { stdout } = await execAsync(`cat ${statPath}`);
9286
afterStats = stdout.trim();
9387
} catch {
94-
core.debug(`Could not read block device stats after flush: ${statPath}`);
88+
core.info(`Could not read block device stats after flush: ${statPath}`);
9589
}
9690

9791
core.info(
@@ -100,7 +94,7 @@ async function flushBlockDevice(devicePath: string): Promise<void> {
10094
} catch (error) {
10195
const duration = Date.now() - startTime;
10296
const errorMsg = error instanceof Error ? error.message : String(error);
103-
core.warning(
97+
core.info(
10498
`guest flush failed for ${devicePath} after ${duration}ms: ${errorMsg}`,
10599
);
106100
}
@@ -678,17 +672,17 @@ void actionsToolkit.run(
678672
// Step 2: Sync and unmount sticky disk
679673
await execAsync("sync");
680674

681-
// BLA-3202: Get device path before unmount for durability flush
675+
// Get device path before unmount for durability flush
682676
let devicePath: string | null = null;
683677
try {
684678
devicePath = await getDeviceFromMount(mountPoint);
685679
if (devicePath) {
686-
core.debug(
680+
core.info(
687681
`Found device ${devicePath} for mount point ${mountPoint}`,
688682
);
689683
}
690684
} catch {
691-
core.debug(`Could not determine device for ${mountPoint}`);
685+
core.info(`Could not determine device for ${mountPoint}`);
692686
}
693687

694688
try {
@@ -754,12 +748,12 @@ void actionsToolkit.run(
754748
}
755749
}
756750

757-
// BLA-3202: Flush block device buffers after unmount to ensure data durability
751+
// Flush block device buffers after unmount to ensure data durability
758752
// before the Ceph RBD snapshot is taken. The device is still mapped even though unmounted.
759753
if (devicePath) {
760754
await flushBlockDevice(devicePath);
761755
} else {
762-
core.debug(
756+
core.info(
763757
"Skipping durability flush: device path not found for mount point",
764758
);
765759
}

0 commit comments

Comments
 (0)