问题描述
我正在尝试使用根据本文档配置的 net.maxwait
为 perforce 命令设置超时:
https://community.perforce.com/s/article/3751
user@test:~/perforce/sandBox$ date; p4 -v net.maxwait=1 sync -f; date
Wed Dec 30 05:38:19 EST 2020
TCP receive Failed.
read: socket stdio: Connection reset by peer
Perforce client error:
TCP receive Failed.
read: socket stdio: Connection reset by peer
Wed Dec 30 05:40:26 EST 2020
但是,我看到 p4 命令仅在 2 分钟(大约)后超时。
为了模拟不可靠网络的场景,我使用 iptables
将传出数据包丢弃到 perforce 服务器:
sudo iptables -D OUTPUT -d 172.27.213.25 -m statistic --mode random --probability 0.9 -p tcp --dport 22 -j DROP
strace
表示要阻止的 connect()
系统调用。
user@test:~$ sudo strace -p 12356
strace: Process 12356 attached
connect(3,{sa_family=AF_INET,sin_port=htons(22),sin_addr=inet_addr("172.27.213.25")},16
我使用的 perforce 版本:
user@test:~/perforce/sandBox$ p4 -V
Perforce - The Fast Software Configuration Management System.
copyright 1995-2014 Perforce Software. All rights reserved.
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/)
See 'p4 help legal' for full OpenSSL license @R_142_4045@ion
Version of OpenSSL Libraries: OpenSSL 1.0.1g 7 Apr 2014
Rev. P4/LINUX26X86_64/2014.1/821990 (2014/04/08).
如何让它按预期工作?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)