Skip to content

Commit

Permalink
test: ci skip: try shorter protocol time
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerinthenight committed Sep 23, 2024
1 parent d83bf6b commit 49cf62c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ pub fn main() !void {
var config = Fleet.Config{
.name = name,
.ip = member[0..sep],
.protocol_time = std.time.ns_per_s * 1,
.suspected_time = std.time.ns_per_s * 1,
.callbacks = callbacks,
};

Expand Down
16 changes: 9 additions & 7 deletions src/zgroup.zig
Original file line number Diff line number Diff line change
Expand Up @@ -561,13 +561,6 @@ pub fn Fleet(UserData: type) type {
defer self.members_mtx.unlock();
var it = self.members.iterator();
while (it.next()) |v| {
log.debug("[{d}] members: key={s}, state={any}, inc={d}", .{
i,
v.key_ptr.*,
v.value_ptr.state,
v.value_ptr.incarnation,
});

if (self.keyIsMe(v.key_ptr.*)) {
if (v.value_ptr.state != .alive) {
v.value_ptr.state = .alive;
Expand All @@ -589,6 +582,15 @@ pub fn Fleet(UserData: type) type {
});
}

const counts = self.getCounts();
log.debug("[{d}] members: alive={d}, suspected={d}, faulty={d}, total={d}", .{
i,
counts[0],
counts[1],
counts[2],
counts[3],
});

try self.removeFaultyMembers();

var key_ptr: ?[]const u8 = null;
Expand Down

0 comments on commit 49cf62c

Please sign in to comment.