惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Blog — PlanetScale
Blog — PlanetScale
博客园 - Franky
The GitHub Blog
The GitHub Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
D
Docker
Google DeepMind News
Google DeepMind News
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Proofpoint News Feed
N
Netflix TechBlog - Medium
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
H
Help Net Security
B
Blog
宝玉的分享
宝玉的分享

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(bonjour): bound stuck advertiser restarts · openclaw/...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -69,6 +69,7 @@ type BonjourAdvertiserDeps = {

6969

const WATCHDOG_INTERVAL_MS = 5_000;

7070

const REPAIR_DEBOUNCE_MS = 30_000;

7171

const STUCK_ANNOUNCING_MS = 8_000;

72+

const MAX_CONSECUTIVE_RESTARTS = 3;

7273

const BONJOUR_ANNOUNCED_STATE = "announced";

7374

const CIAO_SELF_PROBE_RETRY_FRAGMENT =

7475

"failed probing with reason: Error: Can't probe for a service which is announced already.";

@@ -332,7 +333,9 @@ export async function startGatewayBonjourAdvertiser(

332333333334

let stopped = false;

334335

let recreatePromise: Promise<void> | null = null;

335-

let cycle = createCycle();

336+

let disabled = false;

337+

let consecutiveRestarts = 0;

338+

let cycle: BonjourCycle | null = createCycle();

336339

const stateTracker = new Map<string, ServiceStateTracker>();

337340

attachConflictListeners(cycle.services);

338341

startAdvertising(cycle.services);

@@ -353,13 +356,26 @@ export async function startGatewayBonjourAdvertiser(

353356

};

354357355358

const recreateAdvertiser = async (reason: string) => {

356-

if (stopped) {

359+

if (stopped || disabled) {

357360

return;

358361

}

359362

if (recreatePromise) {

360363

return recreatePromise;

361364

}

362365

recreatePromise = (async () => {

366+

consecutiveRestarts += 1;

367+

if (consecutiveRestarts > MAX_CONSECUTIVE_RESTARTS) {

368+

disabled = true;

369+

logger.warn(

370+

`bonjour: disabling advertiser after ${MAX_CONSECUTIVE_RESTARTS} failed restarts (${reason}); set discovery.mdns.mode="off" or OPENCLAW_DISABLE_BONJOUR=1 to disable mDNS discovery`,

371+

);

372+

const previous = cycle;

373+

cycle = null;

374+

stateTracker.clear();

375+

await stopCycle(previous, { shutdownResponder: true });

376+

restoreConsoleLog();

377+

return;

378+

}

363379

logger.warn(`bonjour: restarting advertiser (${reason})`);

364380

const previous = cycle;

365381

await stopCycle(previous);

@@ -378,12 +394,18 @@ export async function startGatewayBonjourAdvertiser(

378394

if (stopped || recreatePromise) {

379395

return;

380396

}

397+

if (disabled || !cycle) {

398+

return;

399+

}

381400

updateStateTrackers(cycle.services);

382401

for (const { label, svc } of cycle.services) {

383402

const stateUnknown = (svc as { serviceState?: unknown }).serviceState;

384403

if (typeof stateUnknown !== "string") {

385404

continue;

386405

}

406+

if (stateUnknown === "announced") {

407+

consecutiveRestarts = 0;

408+

}

387409

const tracked = stateTracker.get(label);

388410

if (

389411

stateUnknown !== "announced" &&