diff mbox series

network/stress/http: Do not use SIGPIPE

Message ID 20230124044227.13635-1-akihiko.odaki@daynix.com
State Accepted
Headers show
Series network/stress/http: Do not use SIGPIPE | expand

Commit Message

Akihiko Odaki Jan. 24, 2023, 4:42 a.m. UTC
curl ignores SIGPIPE according to:
https://github.com/curl/curl/commit/e2bcd2ab9e5ad894a57756fa660d2a07b69171f4

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 testcases/network/stress/http/http-stress02-rmt.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Petr Vorel Jan. 24, 2023, 11:27 a.m. UTC | #1
Hi Akihiko,

> curl ignores SIGPIPE according to:
> https://github.com/curl/curl/commit/e2bcd2ab9e5ad894a57756fa660d2a07b69171f4

curl 7.29 (10 years old).

Reviewed-by: Petr Vorel <pvorel@suse.cz>

I haven't tested http-stress.sh, just manually curl, which really ignores
SIGPIPE. This should be merged before release.

Kind regards,
Petr
Petr Vorel Jan. 24, 2023, 12:28 p.m. UTC | #2
Hi Akihiko,

> > curl ignores SIGPIPE according to:
> > https://github.com/curl/curl/commit/e2bcd2ab9e5ad894a57756fa660d2a07b69171f4

Although curl really does not kill when testing manually, running:
curl -L -o /tmp/delete.iso http://download.opensuse.org/tumbleweed/iso/openSUSE-Tumbleweed-DVD-x86_64-Current.iso

In another terminal this blocks:
killall -w -s SIGPIPE curl

But when I tested with nginx the original code with -s SIGPIPE) it works:

export HTTP_DOWNLOAD_DIR=/srv/www/htdocs/
PATH="/opt/ltp/testcases/bin:$PATH" http-stress.sh -i3

http-stress 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface
http-stress 1 TINFO: add local addr 10.0.0.2/24
http-stress 1 TINFO: add local addr fd00:1:1:1::2/64
http-stress 1 TINFO: initialize 'rhost' 'ltp_ns_veth1' interface
http-stress 1 TINFO: add remote addr 10.0.0.1/24
http-stress 1 TINFO: add remote addr fd00:1:1:1::1/64
http-stress 1 TINFO: Network config (local -- remote):
http-stress 1 TINFO: ltp_ns_veth2 -- ltp_ns_veth1
http-stress 1 TINFO: 10.0.0.2/24 -- 10.0.0.1/24
http-stress 1 TINFO: fd00:1:1:1::2/64 -- fd00:1:1:1::1/64
http-stress 1 TINFO: run over IPv4
http-stress 1 TINFO: http client download test file
http-stress01-rmt 1 TINFO: stat: time=0.933851 size=2147483647 speed=2299599879
http-stress 1 TPASS: Test is finished successfully
http-stress 2 TINFO: clients request data asynchronously 10 sec
http-stress02-rmt 1 TINFO: stat: time=1.464465 size=2147483647 speed=1466394654
http-stress 2 TPASS: Test is finished successfully

pgrep -a curl # nothing

Not sure what am I missing, but I don't see any problem to accept this patch.

Kind regards,
Petr
Petr Vorel Jan. 25, 2023, 9:30 p.m. UTC | #3
Hi Akihiko,

merged, thank you!

Kind regards,
Petr
diff mbox series

Patch

diff --git a/testcases/network/stress/http/http-stress02-rmt.sh b/testcases/network/stress/http/http-stress02-rmt.sh
index 1734c2bd3..d7a77d3ea 100755
--- a/testcases/network/stress/http/http-stress02-rmt.sh
+++ b/testcases/network/stress/http/http-stress02-rmt.sh
@@ -60,7 +60,7 @@  while true ; do
 		-o /dev/null &
 done
 
-killall -qw -s SIGPIPE curl
+killall -qw curl
 
 out=$(curl --noproxy '*' -sS -g "http://$server_ipaddr/$filename" -o /dev/null \
 	-w "time=%{time_total} size=%{size_download} speed=%{speed_download}")