mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
std.Build.Watch: gracefully handle fanotify queue overflow
This commit is contained in:
parent
e712ca595f
commit
956f1ebc70
@ -135,6 +135,12 @@ pub fn markDirtySteps(w: *Watch, gpa: Allocator) !bool {
|
||||
meta = @ptrCast(@as([*]u8, @ptrCast(meta)) + meta[0].event_len);
|
||||
}) {
|
||||
assert(meta[0].vers == M.VERSION);
|
||||
if (meta[0].mask.Q_OVERFLOW) {
|
||||
any_dirty = true;
|
||||
std.log.warn("file system watch queue overflowed; falling back to fstat", .{});
|
||||
markAllFilesDirty(w, gpa);
|
||||
return true;
|
||||
}
|
||||
const fid: *align(1) fanotify.event_info_fid = @ptrCast(meta + 1);
|
||||
switch (fid.hdr.info_type) {
|
||||
.DFID_NAME => {
|
||||
@ -171,3 +177,13 @@ pub fn markFailedStepsDirty(gpa: Allocator, all_steps: []const *Step) void {
|
||||
else => continue,
|
||||
};
|
||||
}
|
||||
|
||||
fn markAllFilesDirty(w: *Watch, gpa: Allocator) void {
|
||||
for (w.handle_table.values()) |reaction_set| {
|
||||
for (reaction_set.values()) |step_set| {
|
||||
for (step_set.keys()) |step| {
|
||||
step.recursiveReset(gpa);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user