{"record":{"id":"14d4d3daa3891db9","repo":"XX-net/XX-Net","slug":"get-front-time-f-for-s-s-s","errorCode":null,"errorMessage":"get_front_time: %f for %s %s %s","messagePattern":"get_front_time: (.+?) for (.+?) (.+?) (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/x_tunnel/local/front_dispatcher.py","lineNumber":173,"sourceCode":"    return num\n\n\ndef request(method, host, path=\"/\", headers={}, data=\"\", timeout=100):\n    # xlog.debug(\"front request %s timeout:%d\", path, timeout)\n    start_time = time.time()\n\n    content, status, response = \"\", 603, {}\n    while time.time() - start_time < timeout:\n        start_get_front = time.time()\n        front = get_front(host, timeout)\n        if not front:\n            xlog.warn(\"get_front fail\")\n            return \"\", 602, {}\n\n        finished_get_front = time.time()\n        get_front_time = finished_get_front - start_get_front\n        if get_front_time > 0.1:\n            xlog.warn(\"get_front_time: %f for %s %s %s\", get_front_time, method, host, path)\n\n        if host == \"dns.xx-net.org\" and front == cloudflare_front and g.server_host:\n            # share the x-tunnel connection with dns.xx-net.org\n            # x-tunnel server will forward the request to dns.xx-net.org\n            if g.server_host:\n                host = g.server_host\n\n        headers[\"X-Async\"] = \"1\"\n        if len(data) < 84:\n            padding = utils.to_str(utils.generate_random_lowercase(random.randint(8, 64)))\n            headers[\"Padding\"] = padding\n\n        content, status, response = front.request(\n            method, host=host, path=path, headers=dict(headers), data=data, timeout=timeout)\n\n        if status not in [200, 521, 400, 404]:\n            xlog.warn(\"front retry %s%s\", host, path)\n            time.sleep(1)","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/x_tunnel/local/front_dispatcher.py#L155-L191","documentation":"Warns that acquiring a front took longer than 100ms inside front_dispatcher.request(). Not a failure by itself; it indicates front scoring/lock contention or the front pool being busy re-checking dead fronts.","triggerScenarios":"get_front() blocking >0.1s: many fronts in re-check backoff, lock contention with the statistics thread, or a large front list being iterated while threads contend.","commonSituations":"Heavy concurrency through x-tunnel local proxy while fronts are mostly dead; low-end hardware; statistics thread updating scores.","solutions":["Reduce concurrency or accept the latency warning","Ensure working fronts exist so get_front isn't rechecking dead ones","Check the front statistic thread logs for why fronts are unhealthy"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep at least some healthy fronts to avoid slow scans","Limit concurrent dispatcher requests on weak hardware"],"tags":["x-tunnel","performance","front"],"backgroundTag":"slow-upstream-selection","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}