MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
16.52k stars 2.65k forks source link

[Bug] 太多的 process not found #613

Open WangHaonie opened 1 year ago

WangHaonie commented 1 year ago

短短 50 秒内刷出了 17000 多行 process not found,就算是同一个软件发出的请求,有时找得到进程,有时就找不到,实在是找不到进程就算了,只需报一行就OK,不然整个日志都是 process not found,影响后续分析,希望可以修复一下。

Clash 版本:alpha-c3ef05b 操作系统:Windows 11 22H2 x64 22631.1830 配置文件:

port: 7890
socks-port: 7891
allow-lan: true
mode: Rule
log-level: info
external-controller: :9090
proxies:
proxy-groups:
rules:
proxy-providers: {}
rule-providers: {}
tun:
  enable: true
  stack: system
  auto-detect-interface: true
  auto-route: true
  dns-hijack:
    - any:53
dns:
  enable: true
  prefer-h3: true
  listen: 0.0.0.0:1053
  ipv6: false
  use-hosts: false
  default-nameserver:
    - 119.29.29.29
  enhanced-mode: fake-ip
  fake-ip-range: 198.18.0.1/16
  fake-ip-filter:
    - "*.lan"
    - localhost.ptlogin2.qq.com
  nameserver-policy:
    geosite:cn: 119.29.29.29
  nameserver:
    - 119.29.29.29
  fallback:
    - 8.8.8.8
  proxy-server-nameserver:
    - 119.29.29.29
  fallback-filter:
    geoip: true
    geoip-code: CN
    geosite:
      - gfw
      - geolocation-!cn
    ipcidr:
      - 240.0.0.0/4
    domain:
      - +.google.com
      - +.facebook.com
      - +.youtube.com
geodata-mode: true
geox-url:
  geoip: https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat
  geosite: https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat
  mmdb: https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/Country.mmdb
find-process-mode: always
tcp-concurrent: true
lazy: false
hosts:
  diskgenius.cn: 0.0.0.0
  www.diskgenius.cn: 0.0.0.0
  2.au.download.windowsupdate.com: 23.216.153.159
  3.au.download.windowsupdate.com: 8.251.135.126
  4.au.download.windowsupdate.com: 111.119.27.0
  images-eds-ssl.xboxlive.com: 23.77.214.7

Log

time="2023-06-08T16:13:57.4934699+08:00" level=debug msg="[Rule] use default rules"
time="2023-06-08T16:13:57.4934699+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:13:57.49447+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:13:57.49447+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:13:57.49447+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:13:57.49447+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:13:57.49447+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:13:57.49447+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:13:57.4954692+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:13:57.4954692+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:13:57.4954692+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"

----------- 省略了 17000+ 行日志 -----------

time="2023-06-08T16:14:47.2276317+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.2281449+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.230349+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.2318726+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.2333783+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.2349124+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.2359135+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.2369125+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.2369125+08:00" level=debug msg="[DNS] oth.eve.mdt.qq.com --> 119.147.6.84"
time="2023-06-08T16:14:47.2379108+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.2399646+08:00" level=debug msg="[Process] find process oth.eve.mdt.qq.com: process not found"
time="2023-06-08T16:14:47.2835639+08:00" level=info msg="[TCP] 198.18.0.1:8650 --> oth.eve.mdt.qq.com:8081 match GeoIP(CN) using 🎯 国内直连[DIRECT]"
WangHaonie commented 1 year ago

刚试了最新的 alpha-cd44901,问题依旧

xishang0128 commented 1 year ago

@WangHaonie debug log刷屏不算bug

vj23456 commented 1 year ago

@WangHaonie 你别写process规则就没了

H1JK commented 1 year ago

This is indeed a problem. In the current implementation, the PROCESS-NAME rule will trigger the process name lookup and cache the result, but if the process name lookup failed (and nothing got cached), the process name will be looked up again every time matching the PROCESS-NAME rules and then the error will be reported repeatedly.

May we only need one such error message per connection, or never do match once failed?

CC @Skyxim

Skyxim commented 1 year ago

This is indeed a problem. In the current implementation, the PROCESS-NAME rule will trigger the process name lookup and cache the result, but if the process name lookup failed (and nothing got cached), the process name will be looked up again every time matching the PROCESS-NAME rules and then the error will be reported repeatedly.

May we only need one such error message per connection, or never do match once failed?

CC @Skyxim

最容易出现的环境其实是路由器或者非本机代理,其实可以对非本机 IP 进行过滤

Skyxim commented 1 year ago

https://github.com/MetaCubeX/Clash.Meta/commit/253c1f4d595b53983993227c215874aebc38a3bc 试试在相同配置下,还会重复查询进程么

WangHaonie commented 1 year ago

https://github.com/MetaCubeX/Clash.Meta/commit/253c1f4d595b53983993227c215874aebc38a3bc 数量确实比之前少了不少 @Skyxim image

之前: image

https://github.com/MetaCubeX/Clash.Meta/commit/c57f17d0944435a9c553ccdb96fefe9b42c28483 也OK

H1JK commented 1 year ago

The repeated error in the previous version is mainly because your configuration uses PROCESS-NAME too frequently. Now we no longer retry failed process lookup.

However, it's still not clear why your process lookup was failed (and even not completely failed).