fix(mesh): 1B.1 review follow-ups
Two review items from Task 1B.1, both diagnostic: 1. CentralCommandGrpcService's "actor not ready" Warning omitted the peer and the correlation id while the decode-failure Warning six lines above carried both. These are the only two ways an ack fails to reach the coordinator, and an operator has to correlate either against the node's own log. Decoding has already succeeded on this path, so the DECODED correlation id is free. 2. A fused driver,admin,cluster-MAIN node under Mode=Grpc owes BOTH validator surfaces at once (driver keys AND ConfigServe:GrpcListenPort). The two blocks are independent `if`s; chained as `else if` a fused central node would be graded on one surface only and boot with nowhere for any ack to land. Pinned from both sides plus the fully-configured pass.
This commit is contained in:
@@ -182,6 +182,26 @@ public sealed class CentralCommandGrpcServiceTests : TestKit
|
||||
.ShouldBeTrue("the rejection log must carry the raw correlation id");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task A_not_ready_rejection_logs_the_peer_and_the_correlation_id()
|
||||
{
|
||||
// Diagnostic symmetry with the decode-failure warning above. The two rejections are the only
|
||||
// two ways an ack fails to reach the coordinator, and an operator reading the central log has
|
||||
// to correlate BOTH against the node's own log — which needs the correlation id — and against
|
||||
// which node was calling, which needs the peer. Decoding has already succeeded on this path,
|
||||
// so the decoded correlation id costs nothing to include.
|
||||
var logger = new CapturingLogger<CentralCommandGrpcService>();
|
||||
var request = WellFormed();
|
||||
|
||||
await Should.ThrowAsync<RpcException>(() =>
|
||||
new CentralCommandGrpcService(new ActorRegistry(), logger)
|
||||
.ReportApply(request, new FakeServerCallContext()));
|
||||
|
||||
var warning = logger.Entries.Single(e => e.Level == LogLevel.Warning);
|
||||
warning.Message.ShouldContain("ipv4:127.0.0.1:0");
|
||||
warning.Message.ShouldContain(request.CorrelationId);
|
||||
}
|
||||
|
||||
/// <summary>Test logger that captures all log entries.</summary>
|
||||
/// <typeparam name="T">The category type.</typeparam>
|
||||
private sealed class CapturingLogger<T> : ILogger<T>
|
||||
|
||||
Reference in New Issue
Block a user