Commit Graph
85 Commits
Author SHA1 Message Date
tsosunchia 79e3b68334 fix(trace): 在稳定不可达响应后停止后续探测
- 在 TTL 尝试稳定后立即提交 unreachable 发送边界
- 优先匹配已登记探测,仅在登记竞态时重试
- 覆盖取消、超时、同跳 transit 优先级与六协议路径
2026-08-15 16:59:14 +08:00
tsosunchia 20ad874194 fix(trace): 保留终止 marker 并按语义维护 MTR 边界
- 分离人类响应与机器 marker,并聚合有界 MTR 终止证据
- 保留 TUI/report 截断后的 marker,区分终端样式与文件纯文本
- 明确输出优先级并补齐 CLI、Fast、Web 回归测试与文档
2026-08-13 12:21:37 +08:00
tsosunchia a39fa7031f fix(trace): 按响应语义收敛 traceroute 终止边界 2026-08-13 11:25:18 +08:00
EveCat ebef637eb2 feat(trace): explain traceroute stop responses 2026-08-13 03:16:18 +08:00
EveCat 1c065129d3 fix(trace): classify probe responses before stopping
Use ICMP response semantics instead of source-address equality to detect transit, destination, and unreachable replies.

Keep tracing when any ECMP path returns a transit response, expose structured stop reasons, and preserve raw and JSON output behavior.
2026-08-12 17:11:34 +08:00
tsosunchia c0f75e2399 fix(trace): 限制 Geo 查询重试偏移 2026-05-25 16:05:20 +08:00
tsosunchia da9e3f7970 fix(trace): 调整 MTR 异步 Geo 超时重试 2026-05-25 08:42:30 +08:00
tsosunchia 9d03daede9 fix(trace): 修复 MTR TCP/UDP GeoIP 补全 (#369)
Refs nxtrace/NTrace-core#369
2026-05-22 11:04:28 +08:00
tsosunchia bf4946243f Prevent stale labels, flaky websocket tests, and speed misreports
Bound Leo IP sends and stale response delivery by timeout, bootstrap speed-mode metadata lookups without JSON banner noise, respect --speed=false pre-dispatch, validate speed source binding, cap probe response reads, avoid caching empty nali labels, treat server-only speed metadata as healthy when no client IP is available, make websocket async tests event-driven, restart Leo receive parsing reliably, close websocket receive channels exactly once, send Leo requests on the waited websocket, back off failed Geo/RDNS metadata lookups, refresh MTR API info cache timestamps after lookup, report upload response read errors, avoid launching latency probes after cancellation, and keep speed JSON tests tolerant of degraded latency samples.
2026-04-19 23:45:16 +08:00
tsosunchia 73a658b089 merge main and resolve trace geo conflict 2026-04-19 08:53:28 +08:00
tsosunchia 1d1c9e1ab1 address remaining async mtr review feedback 2026-04-19 08:48:57 +08:00
tsosunchia 9edb724581 fix review regressions in async mtr metadata 2026-04-19 01:07:57 +08:00
tsosunchia 1b8a53e1b5 fix remaining speed review issues 2026-04-18 19:35:14 +08:00
tsosunchia 407ed64574 address speed mode review feedback 2026-04-18 19:11:13 +08:00
tsosunchia 7b8e68710c Fix cancellation handling across DNS, trace, and ws flows 2026-03-19 12:22:02 +08:00
tsosunchia 21396148d0 fix: improve Windows mtu handling and privilege prompts 2026-03-19 00:14:08 +08:00
tsosunchia d9dbcc2a38 feat: align psize semantics and add tos 2026-03-17 16:41:10 +08:00
tsosunchia 0b0c6662e8 修复 MTR 调度 goroutine 泄漏 2026-03-15 22:11:44 +08:00
tsosunchia 4f4cb0dc16 feat: enhance target port stripping and add tests for edge cases 2026-03-10 23:20:48 +08:00
tsosunchia 81797d4b5f Improve gocyclo complexity 2026-03-08 10:54:41 +08:00
tsosunchia 77abf1b515 Refactor MTR signal handling and context management
- Unified signal handling in MTR CLI using `signal.NotifyContext(...)` for Ctrl-C/SIGTERM, removing the need for separate `sigCh` and goroutine.
- Updated `runMTRTUI`, `runMTRReport`, and `runMTRRaw` functions to utilize the new context management.
- Enhanced `mtrUI` to safely call `cancel()` only if it is not nil.
- Modified `IPDBOneClient` to clone HTTP clients with timeout settings, ensuring proper timeout handling without modifying global state.
- Adjusted raw aggregation keys in the frontend to collapse based on TTL, improving display of timeout/success results.
- Added context support in various tracer functions to allow cancellation and timeout handling.
- Improved error handling and test coverage for MTR operations, ensuring robustness against nil results and empty responses.
- Refined DNS resolver functions to use mutexes for thread-safe access to the geo resolver override.
2026-03-06 14:07:58 +08:00
tsosunchia a9a2325762 feat: enhance build scripts and improve error handling for Windows TCP traces 2026-03-06 13:48:16 +08:00
tsosunchia f69903a00c fix(web): resolve post-v1.5.0 review findings
Address all three review findings from the v1.5.0..HEAD audit:\n- Remove Web MTR reliance on process-wide globals (SrcDev/DisableMPLS) by passing session-scoped trace.Config fields.\n- Apply dot_server consistently to Web/API Geo DNS and LeoMoe/FastIP initialization via scoped resolver setup.\n- Restore Web MTR default per-hop cadence to 1000ms and send hop_interval_ms from frontend.\n\nAlso added regression tests in server/trace_handler_test.go and util/dns_resolver_test.go, and updated CLAUDE.md.\n\nValidation passed:\n- go test ./...\n- go build ./...\n- go build -tags flavor_ntr ./...\n- go build -tags flavor_tiny ./...\n- node --check server/web/assets/app.js
2026-03-06 13:04:42 +08:00
tsosunchia e63c4159c1 fix(trace): 优化 CanonicalHostname 函数,简化去掉尾点的逻辑 2026-03-01 18:51:43 +08:00
tsosunchia 33873a5245 feat: 添加地理数据初始化和超时处理逻辑 2026-02-08 20:22:10 +08:00
tsosunchia fd56e8946a feat(trace): 异步化 Geo 查询以降低探测延迟
- 将 fetchIPData 改为通过 addWithGeoAsync 异步执行
- 新增 waitGeo 机制,在打印每个 TTL 前等待 Geo 数据就绪
- 为 geoWG.Wait 添加 30 秒总超时,防止无限阻塞
- 无论是否有错误都等待 geoWG 完成,避免返回后结果仍被修改
- 在 printer 中增加 pending 状态保护,避免空指针访问
- 导出 PendingGeoSource 常量供跨包使用
- 修改 Result.add 返回 (bool, int) 以追踪插入索引

此变更将 Geo/DNS 查询从主探测路径解耦,显著降低用户感知延迟,
同时通过 sync.Map 缓存和 singleflight 去重保持结果一致性。
2025-12-21 21:45:44 +08:00
Yunlq 7aedfdd5f8 完善了geoip查询失败时的错误处理 2025-11-19 22:51:13 +08:00
Yunlq 0fde1e44c6 优化了MPLS Label的提取函数 2025-11-19 16:58:20 +08:00
tsosunchia 75db288c0b 移除 trace/trace.go 中的全局 lastErr,改为线程安全的错误处理。加强 util/util.go 的 DomainLookUp 返回逻辑,确保在无可用 IP 时优雅地报错而不是 panic。
Signed-off-by: tsosunchia <59512455+tsosunchia@users.noreply.github.com>
2025-10-29 19:50:38 +08:00
tsosunchia d8418d7ec5 Add locking mechanism to Result.reduce for thread safety 2025-10-29 11:05:54 +08:00
Yunlq 114fa5c543 增加geoip查询失败时的重试次数,减少由此引起的panic概率 2025-10-04 12:07:54 +08:00
Yunlq 72a3781ec5 优化了ICMP模式,提升了其在Windows上的表现 2025-10-04 10:59:43 +08:00
Yunlq c7e663fa99 优化了UDP模式,提升了其在NAT环境下的表现 2025-09-22 21:01:43 +08:00
Yunlq 867008a0c0 优化了启动阶段,减少首跳丢包率 2025-09-13 12:20:22 +08:00
Yunlq 10c567287e 完成了windows上的TCP路由跟踪 2025-09-13 02:04:26 +08:00
Yunlq 81efadb8f5 完善了错误处理 2025-08-27 10:57:22 +08:00
tsosunchia 7fec94c6d9 移除DontFragment功能 2025-08-26 19:58:04 +08:00
Yunlq ac2b51451e 移除了PrintFunc中的status通道,使用WithCancelCause区分中断退出 2025-08-26 16:25:02 +08:00
Yunlq 3f601e7326 为TCP/UDP等模式引入MPLS Label支持 2025-08-26 15:34:35 +08:00
Yunlq 267ee4aa2e 完成了UDP/UDPv6模式的并发优化 2025-08-21 17:05:20 +08:00
tsosunchia 424d31760a 稳定mpls表现 2025-08-19 00:21:55 +08:00
tsosunchia c3780f2d7e 修复mpls功能在不严格返回payload网络下的表现 2025-08-18 21:50:42 +08:00
tsosunchia 042ec709ec Merge branch 'main' into main 2025-08-18 14:42:26 +08:00
tsosunchia 8aad34f738 修mpls功能 2025-08-17 20:31:10 +08:00
Yunlq ea54b2c0c4 优化并统一了环境变量的读取和使用 2025-08-17 15:04:57 +08:00
Yunlq 0905975c24 完善了fetchIPData()函数的类型断言和nil保护 2025-08-16 15:59:36 +08:00
Yunlq 1a1a86a417 完善TCP/UDP的SrcIP绑定与端口可用性检测 2025-08-15 23:30:43 +08:00
Yunlq b1092ede15 全面引入context链路,优化了中断退出的流程 2025-08-14 15:01:58 +08:00
Yunlq 33ff3b3e01 优化了锁的使用和fetchIPData()函数的实现 2025-08-13 17:50:01 +08:00
Yunlq ffd67a1d2d 优化了低Query场景下高丢包跳的输出 2025-08-10 23:27:50 +08:00