1

I am trying to set timeout to the perforce commands using the net.maxwait configurable as per this document: 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

But, I see that the p4 command times-out only after 2mins (approx).

To simulate the scenario of an unreliable network, I'm using iptables to drop the outgoing packets to the perforce server:

sudo iptables -D OUTPUT -d 172.27.213.25 -m statistic --mode random --probability 0.9 -p tcp --dport 22 -j DROP

strace indicates the connect() system call to be blocked.

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

The perforce version that I'm using:

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).

How do I get this to work as expected?

Safwan
  • 29
  • 6

0 Answers0