1

我正在尝试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 information
Version of OpenSSL Libraries: OpenSSL 1.0.1g 7 Apr 2014
Rev. P4/LINUX26X86_64/2014.1/821990 (2014/04/08).

我如何让它按预期工作?

4

0 回答 0