v2ray-core icon indicating copy to clipboard operation
v2ray-core copied to clipboard

observatory 定时检测的问题

Open nil-ref opened this issue 1 year ago • 2 comments

observatory:
    probeInterval: 60m
    probeURL: https://example.com
    subjectSelector:
     - Proxy
2023/12/31 19:04:08 [Warning] core: Xray 1.8.6 started
2023/12/31 19:04:08 [Info] app/dispatcher: taking platform initialized detour [Proxy1] for [tcp:example.com:443]
2023/12/31 19:04:08 [Info] transport/internet/tcp: dialing TCP to tcp:192.168.123.203:1089
2023/12/31 19:04:08 [Debug] transport/internet: dialing to tcp:192.168.123.203:1089
2023/12/31 19:04:13 [Info] app/observatory: the outbound Proxy1 is dead: > app/observatory: GET request failed:app/observatory: outbound failed to relay connection > Get "https://example.com": net/http: TLS handshake timeout (Client.Timeout exceeded while awaiting headers) > app/observatory: with outbound handler report > app/observatory: underlying connection failed > app/observatory: failed to produce report
2023/12/31 19:04:23 [Info] transport/internet/tcp: dialing TCP to tcp:192.168.123.203:1089
2023/12/31 19:04:26 [Debug] transport/internet: dialing to tcp:192.168.123.203:1089

可以看到 observatory 检测 the outbound Proxy1 is dead 之后, 就不会管后面的 Proxy2, Proxy3... 必须等 probeInterval: 60分钟过后才检测.

于是我验证了下设置 probeInterval: 10s 确实是如此:

xray run -c config.yaml | grep "app/observatory"
2023/12/31 19:08:40 [Info] app/observatory: the outbound Proxy1 is dead: > app/observatory: GET request failed:app/observatory: outbound failed to relay connection > Get "https://example.com": net/http: TLS handshake timeout (Client.Timeout exceeded while awaiting headers) > app/observatory: with outbound handler report > app/observatory: underlying connection failed > app/observatory: failed to produce report
2023/12/31 19:08:51 [Info] app/observatory: the outbound Proxy2 is alive:0.70848
2023/12/31 19:09:04 [Info] app/observatory: the outbound Proxy3 is dead: > app/observatory: GET request failed:app/observatory: outbound failed to relay connection > Get "https://example.com": context deadline exceeded (Client.Timeout exceeded while awaiting headers) > app/observatory: with outbound handler report > app/observatory: underlying connection failed > app/observatory: failed to produce report
2023/12/31 19:09:17 [Info] app/observatory: the outbound Proxy1 is dead: > app/observatory: GET request failed:app/observatory: outbound failed to relay connection > Get "https://example.com": net/http: TLS handshake timeout (Client.Timeout exceeded while awaiting headers) > app/observatory: with outbound handler report > app/observatory: underlying connection failed > app/observatory: failed to produce report

是否可以增加这种一次全部检测的方式. 这样一开始就可以直接排除掉 dead 的服务器, 而不是要等 probeInterval * n 花很长时间才能排除.

nil-ref avatar Dec 31 '23 11:12 nil-ref

然后我试了 BurstObservatory

BurstObservatory:
    pingConfig:
        interval: 60m
    subjectSelector:
     - Proxy

可是 BurstObservatory 程序启动后并不会主动运行一次, 依旧要等60分钟..

nil-ref avatar Dec 31 '23 12:12 nil-ref

https://github.com/v2fly/v2ray-core/issues/2443

nil-ref avatar Dec 31 '23 12:12 nil-ref

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Apr 30 '24 01:04 github-actions[bot]