ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: Sergey Vlasov <vsu@altlinux.ru>
To: ALT Linux Sisyphus mailing list <sisyphus@altlinux.org>
Subject: Re: [sisyphus] Re: broken pipe
Date: Wed, 7 Sep 2005 13:26:23 +0400
Message-ID: <20050907092623.GA11890@master.mivlgu.local> (raw)
In-Reply-To: <20050907091105.GW3539@solemn.turbinal.org>

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

On Wed, Sep 07, 2005 at 01:11:05PM +0400, Alexey Tourbin wrote:
> On Mon, Sep 05, 2005 at 03:19:19AM +0400, Dmitry V. Levin wrote:
> > > Мне от робота на stderr происходит следующий стук:
> > > /raid/at/qa/qa-robot/qa-robot: line 113: 14965 Broken pipe	perl -MList::Util=shuffle -e 'print shuffle(<>)' ${1+"$@"}
> > > 
> > > 	shuffle() { perl -MList::Util=shuffle -e 'print shuffle(<>)' ${1+"$@"}; }
> > > 	shuffle {bad,pending}.bugs |head -20 |sort -u |shuffle |head -10 |xfmt1
> > > 
> > > Кто-нибудь может объяснить, почему он происходит?
> > 
> > Это классика: какая-то программа (perl -M...) генерит много строк, head
> > использует только первые несколько, в результате канал закрывается до
> > того, как perl успевает всё туда записать, и perl получает SIGPIPE.
> 
> А кто говорит "Broken pipe"?  То есть это shell говорит, когда делает
> wait(2) и видит WIFSIGNALED и WTERMSIG == SIGPIPE?  Кажется, я начинаю
> понимать, как это всё работает. :)
> 
> И как же от этой напасти защититься?  То есть процесс получает SIGPIPE
> при первой же попытке записи в дохлый пайп?  Если бы wirte(2) хотя бы
> один раз -1 вернул, перл может быть и сам бы отвалил.

$SIG{'PIPE'} = 'IGNORE' ?

Или вообще perl -MList::Util=shuffle -e "print((shuffle(<>))[0..$n])" и
убрать head.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2005-09-07  9:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-04 23:06 [sisyphus] I: Sisyphus-20050905 bugs: +9 -9 (1914) Alexey M. Tourbin
2005-09-04 23:15 ` [sisyphus] broken pipe Alexey Tourbin
2005-09-04 23:19   ` Dmitry V. Levin
2005-09-07  9:11     ` [sisyphus] " Alexey Tourbin
2005-09-07  9:26       ` Sergey Vlasov [this message]
2005-09-07 22:41         ` Alexey Tourbin
2005-09-07 22:58           ` Dmitry V. Levin
2005-09-07 23:05             ` Alexey Tourbin
2005-09-06 20:02 ` [sisyphus] I: Sisyphus-20050905 bugs: +9 -9 (1914) Igor Zubkov
2005-09-06 21:40   ` [sisyphus] " Alexey Tourbin
2005-09-06 22:07     ` Igor Zubkov
2005-09-07  8:57       ` Alexey Tourbin
2005-09-07  9:21       ` [sisyphus] Re: I: Sisyphus-20050905 bugs: +9 -9 (1914) [JT] Vitaly Lipatov
2005-09-07 16:16       ` [sisyphus] Re: I: Sisyphus-20050905 bugs: +9 -9 (1914) Andrey Rahmatullin
2005-09-12 12:09         ` Igor Zubkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050907092623.GA11890@master.mivlgu.local \
    --to=vsu@altlinux.ru \
    --cc=sisyphus@altlinux.org \
    --cc=sisyphus@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git