Skip to content

Commit

Permalink
lib: ci skip: disable removal of faulty members for now
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerinthenight committed Sep 23, 2024
1 parent 49cf62c commit d4d222a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY src/ ./src/
COPY build* ./
RUN curl -O https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz && \
xz --decompress zig-linux-x86_64-0.13.0.tar.xz && tar -xf zig-linux-x86_64-0.13.0.tar && \
./zig-linux-x86_64-0.13.0/zig build -Doptimize=ReleaseSafe --summary all
./zig-linux-x86_64-0.13.0/zig build -Doptimize=ReleaseFast --summary all

FROM debian:stable-slim
RUN set -x && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
Expand Down
8 changes: 8 additions & 0 deletions src/scratch.zig
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,11 @@ test "returnblock" {

dbg("should not be here\n", .{});
}

test "accesslen" {
const i: usize = 1;
const buf = try std.fmt.allocPrint(std.testing.allocator, "hello world {d}", .{i});
dbg("len={d}\n", .{buf.len});
std.testing.allocator.free(buf);
dbg("len={d}\n", .{buf.len});
}
8 changes: 5 additions & 3 deletions src/zgroup.zig
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,6 @@ pub fn Fleet(UserData: type) type {
counts[3],
});

try self.removeFaultyMembers();

var key_ptr: ?[]const u8 = null;
const pt = try self.getPingTarget(arena);
if (pt) |v| key_ptr = v; // ensure non-null
Expand Down Expand Up @@ -709,6 +707,11 @@ pub fn Fleet(UserData: type) type {
try self.callbacks.onLeader.?(self.allocator, self.callbacks.data, me);
}

// TODO: At the moment, this causes intermittent crashes due to keys
// becoming freed. Needs more investigation. For now, we're not
// removing any keys; just keep them all with .faulty state.
// try self.removeFaultyMembers();

// Pause before the next tick.
const elapsed = tm.read();
if (elapsed < self.protocol_time) {
Expand Down Expand Up @@ -1105,7 +1108,6 @@ pub fn Fleet(UserData: type) type {
// Handle the isd_* faulty protocol of the message payload.
// We are passing in an arena allocator here.
fn handleConfirmFaulty(self: *Self, allocator: std.mem.Allocator, msg: *Message) !void {
log.debug(">>>>> listen: confirm faulty", .{});
const key = try keyFromIpPort(allocator, msg.isd_ip, msg.isd_port);
if (!self.keyIsMe(key)) {
try self.setMemberInfo(key, .faulty, null, true);
Expand Down

0 comments on commit d4d222a

Please sign in to comment.