Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

虽然设置了代理,但是仍然卡住,是否可以把ping改为用curl之类的探测 #4470

Closed
heheda123123 opened this issue Dec 5, 2023 · 10 comments

Comments

@heheda123123
Copy link
Contributor

你在什么场景下需要该功能?

如图创建了一个新项目,里面用到了cpptrace。但是看提示,在ping github的时候会卡住,图中卡了一分钟没动
image

但是我已经设置了socks代理了,只是代理不会管icmp的流量。
是否可以把ping gitee 和ping github改为用curl去测试,或者当设置了代理时改用curl也行

描述可能的解决方案

如上,把ping测试访问gitee和github改为用curl去测试

描述你认为的候选方案

No response

其他信息

No response

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: Although the proxy is set, it is still stuck. Is it possible to change ping to use curl or other detection methods?

In what scenario do you need this function?

As shown in the figure, a new project is created, which uses cpptrace. But according to the prompts, it will get stuck when pinging github. The picture is stuck for a minute without moving.
image

But I have set up a socks proxy, but the proxy will not manage icmp traffic.
Is it possible to change ping gitee and ping github to curl for testing? Or can I use curl instead when setting up a proxy?

Describe possible solutions

As above, change the ping test to access gitee and github and use curl to test.

Describe your alternatives

No response

other information

No response

@waruqi
Copy link
Member

waruqi commented Dec 5, 2023

image

显示这个的时候,其实已经 ping 完了,每个 ping 我限制的 1s 超时,顶多卡 1s 。。不一定是 ping 的问题。。

参考这个看下详细位置 #2033

@heheda123123
Copy link
Contributor Author

heheda123123 commented Dec 5, 2023

这里还是没看出来原因
image
ping了三个目标,然后过了2分钟,ping gitlab的才显示出来,不过显示ping的时间很短,不知道卡在哪里了
完整的记录如下

[cat@archlinux temp]$ XMAKE_PROFILE=stuck xmake f -vD -P testlag
<subprocess: cat>: cat /proc/cpuinfo
checking for platform ... linux
checking for architecture ... x86_64
<subprocess: which>: which gcc
<subprocess: gcc>: /usr/bin/gcc --version
checking for gcc ... /usr/bin/gcc
<subprocess: gcc>: /usr/bin/gcc --version
<subprocess: which>: which zig
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
<subprocess: which>: which zig
checkinfo: cannot runv(zig version), No such file or directory
checking for zig ... no
<subprocess: which>: which unzip
<subprocess: unzip>: /usr/bin/unzip -v
checking for unzip ... /usr/bin/unzip
<subprocess: which>: which git
<subprocess: git>: /usr/bin/git --version
checking for git ... /usr/bin/git
<subprocess: which>: which gzip
<subprocess: gzip>: /usr/bin/gzip --version
checking for gzip ... /usr/bin/gzip
<subprocess: which>: which tar
<subprocess: tar>: /usr/bin/tar --version
checking for tar ... /usr/bin/tar
<subprocess: which>: which ping
<subprocess: ping>: /usr/bin/ping -c 1 -W 1 127.0.0.1
checking for ping ... /usr/bin/ping
<subprocess: ping>: /usr/bin/ping -c 1 -W 1 github.com
<subprocess: ping>: /usr/bin/ping -c 1 -W 1 gitlab.com
<subprocess: ping>: /usr/bin/ping -c 1 -W 1 gitee.com
pinging the host(github.com) ... 84 ms
pinging the host(gitee.com) ... 33 ms
pinging the host(gitlab.com) ... 194 ms
/usr/bin/git rev-parse HEAD
<subprocess: git>: /usr/bin/git rev-parse HEAD
checking for cmake ... no
<subprocess: which>: which cmake
<subprocess: cmake>: /usr/bin/cmake --version
checking for cmake ... /usr/bin/cmake
<subprocess: cmake>: /usr/bin/cmake --version
finding zlib from xmake ..
checking for xmake::zlib ... no
finding zlib from pacman ..
<subprocess: which>: which pacman
<subprocess: pacman>: /usr/bin/pacman --version
checking for pacman ... /usr/bin/pacman
<subprocess: pacman>: /usr/bin/pacman -Q -l zlib
<subprocess: which>: which pkg-config
<subprocess: pkg-config>: /usr/bin/pkg-config --version
checking for pkg-config ... /usr/bin/pkg-config
<subprocess: pkg-config>: /usr/bin/pkg-config --cflags zlib
<subprocess: pkg-config>: /usr/bin/pkg-config --libs zlib
<subprocess: pkg-config>: /usr/bin/pkg-config --modversion zlib
checking for pacman::zlib ... zlib 1.3
finding zstd from xmake ..
checking for xmake::zstd ... no
<subprocess: which>: which emerge
checkinfo: cannot runv(emerge --version), No such file or directory
checking for emerge ... no
finding zstd from brew ..
<subprocess: which>: which brew
checking for brew ... no
finding zstd from vcpkg ..
finding zstd from conan ..
finding zstd from pkgconfig ..
<subprocess: pkg-config>: /usr/bin/pkg-config --cflags zstd
finding zstd from pacman ..
<subprocess: pacman>: /usr/bin/pacman -Q -l zstd
<subprocess: pkg-config>: /usr/bin/pkg-config --cflags libzstd
<subprocess: pkg-config>: /usr/bin/pkg-config --libs libzstd
<subprocess: pkg-config>: /usr/bin/pkg-config --modversion libzstd
checking for zstd ... pacman::zstd 1.5.5
finding libdwarf from xmake ..
checking for xmake::libdwarf ... libdwarf 0.8.0
finding cpptrace from xmake ..
checking for xmake::cpptrace ... cpptrace v0.3.1
configure
{
    arch = x86_64
    mode = release
    buildir = build
    host = linux
    ccache = true
    plat = linux
    kind = static
    ndk_stdcxx = true
}
[cat@archlinux temp]$ 

@heheda123123
Copy link
Contributor Author

而且这个问题还不是稳定触发的,有时候执行又很快结束了。过一会儿又会卡
image

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Moreover, this problem is not triggered stably, and sometimes the execution ends quickly. It will get stuck again after a while
image

@heheda123123
Copy link
Contributor Author

heheda123123 commented Dec 5, 2023

破案了,还真是ping gitlab的原因,我手动执行ping,这里也是卡着没返回
image
linux上的ping是会主动再去做dns解析,加上-n就可以立刻返回了
我估计-W只是限制到ping响应,但是没有限制后续dns解析的时间,我之前也被类似的问题坑过

waruqi added a commit that referenced this issue Dec 5, 2023
@waruqi
Copy link
Member

waruqi commented Dec 5, 2023

改进了下,再试试

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Improve it and try again

@heheda123123
Copy link
Contributor Author

没问题了非常快

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


No problem, very fast

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants