CB-307: primary-gate cleanup of push-loop (drop dead clock, IDE 0/0)
Primary verification pass over the delegated push-loop delivery: - Remove the unused LongSupplier clock threaded into ReplyPushLoop (timing is the scheduler's; the field was never read) from the component, Bridged wiring, and both test call sites. - Collapse the single-statement WAIT_BUSY switch arm (redundant block). - Drop now-dead test scaffolding: the always-"idle" recordingClient param and unused AgentStatus/AtomicReference imports. IDE diagnostics 0/0 on all changed files; mvn clean install green (242 tests, 0 failures).
This commit is contained in:
@@ -144,7 +144,7 @@ public final class Bridged {
|
||||
var pushScheduler = Executors.newSingleThreadScheduledExecutor(r ->
|
||||
Thread.ofVirtual().name("bridge-push-").unstarted(r));
|
||||
var pushLoop = new ReplyPushLoop(primaryRegistry, agents, replyInbox,
|
||||
System::nanoTime, pushScheduler, maxReminders, backoffMs);
|
||||
pushScheduler, maxReminders, backoffMs);
|
||||
MessageService messages = new MessageService(agents, injector, rendezvous, replyInbox, pushLoop);
|
||||
|
||||
// MCP server face (CB-105): bridge_send/bridge_reply/bridge_status, mounted at /mcp.
|
||||
|
||||
@@ -9,7 +9,6 @@ import org.slf4j.LoggerFactory;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.LongSupplier;
|
||||
|
||||
/**
|
||||
* Mechanism (b) of CB-307: a dedicated, status-gated push loop that nudges the primary's own
|
||||
@@ -31,7 +30,6 @@ public final class ReplyPushLoop {
|
||||
private final PrimaryRegistry primaryRegistry;
|
||||
private final AgentControl agents;
|
||||
private final ReplyInbox inbox;
|
||||
private final LongSupplier clock;
|
||||
private final ScheduledExecutorService scheduler;
|
||||
private final int maxReminders;
|
||||
private final long backoffMs;
|
||||
@@ -40,12 +38,11 @@ public final class ReplyPushLoop {
|
||||
private final ConcurrentHashMap<String, Boolean> activeTargets = new ConcurrentHashMap<>();
|
||||
|
||||
public ReplyPushLoop(PrimaryRegistry primaryRegistry, AgentControl agents, ReplyInbox inbox,
|
||||
LongSupplier clock, ScheduledExecutorService scheduler,
|
||||
ScheduledExecutorService scheduler,
|
||||
int maxReminders, long backoffMs) {
|
||||
this.primaryRegistry = primaryRegistry;
|
||||
this.agents = agents;
|
||||
this.inbox = inbox;
|
||||
this.clock = clock;
|
||||
this.scheduler = scheduler;
|
||||
this.maxReminders = maxReminders;
|
||||
this.backoffMs = backoffMs;
|
||||
@@ -116,10 +113,8 @@ public final class ReplyPushLoop {
|
||||
injectNudge(target, reminderCount);
|
||||
scheduleNext(target, reminderCount + 1);
|
||||
}
|
||||
case WAIT_BUSY -> {
|
||||
// Re-check after the configured backoff; the primary may become injectable soon.
|
||||
scheduleNext(target, reminderCount);
|
||||
}
|
||||
// Re-check after the configured backoff; the primary may become injectable soon.
|
||||
case WAIT_BUSY -> scheduleNext(target, reminderCount);
|
||||
case STOP -> {
|
||||
activeTargets.remove(target);
|
||||
log.debug("push: reminder loop ended for {}", target);
|
||||
|
||||
Reference in New Issue
Block a user